Jevit Tith 8 лет назад
Родитель
Сommit
18e8ae5834
1 измененных файлов: 11 добавлений и 0 удалений
  1. 11
    0
      JevitT_DieSample

+ 11
- 0
JevitT_DieSample Просмотреть файл

@@ -0,0 +1,11 @@
1
+/* Die is meant to simulate the rolling of a traditional 6 sided die. the code
2
+allows for a variable number of sides, and will return a random number based on
3
+the number of sides. The Die code is very well organized. The notes are helpful
4
+in determining what each function does. The labeling of words also play a very
5
+important role in identification. The author organized the class into multiple
6
+methods such as getNumSides, roll, getResult, equals, and toString. The variable
7
+DEFAULT_SIDES sets the number of sides to the Die, it includes in the precondition
8
+that the Die must be greater than 1 side. The roll method calls the random number
9
+generator. Methods are created of the sole purpose of organizing and making the
10
+code easier to interpret. Instead of have one large method, the writer divides
11
+the function into multiple small methods and then later call those methods. */