If you have played games of chance such as craps, or board games such as Parker Brothers' Monopoly, you are familiar with the six-sided die, which is a small cube on whose six sides appear, respectively, one dot, two dots, three dots, ..., six dots. Here is an image of a pair of dice (which is the plural of die). In games such as these, a player begins his turn by tossing a die, or possibly two or more dice (the plural of `die'), onto a flat surface (such as a table). Exactly what happens during that turn depends upon which side of each die ---in particular, the number of dots on that side of the die--- ends up facing upward. We refer to this number of dots as the result of the toss. For example, in Monopoly, a player tosses a pair of dice (which is the same thing as tossing one die and then another) and gets to move forward a number of squares equal to the sum of the results of the two tosses, which could be anything from 2 to 12.
For this assignment, you are to complete the development of the Java class SixSidedDie, each instance of which is intended to be a model of a fair, six-sided die. (By fair we mean that each of its six sides is equally likely to be the result of a toss.)
As the basis for tossing a die, it is recommended that you use an instance of the class java.util.Random. Specifically, to toss a die you would probably want to invoke the object's nextInt(int) method. Don't forget to import java.util.Random into your SixSidedDie class. Also see the links on the course web page to the class TossableFairCoin that we developed during lecture and the class TossableFairCoinTester that can be used for testing purposes.
Also provided for you is the class SixSidedDieTester, whose purpose is suggested by its name.
Submit the source code of your class (i.e., the .java file, not the .class file) via e-mail to your instructor at mccloske@cs.uofs.edu