weight = 17
Overview
For this assignment, you will need to use your creativity to develop a
program that makes use of the Die
class shown below that is similar
to what was developed in lecture.
Assignment
+-------------------------------+
| Die |
+-------------------------------+
| -numSides: int {readOnly} |
| -currentValue: int |
| -generator: Random <<static>> |
+-------------------------------+
| +Die(numSides: int) |
| +Die() |
| +getCurrentValue(): int |
| +roll(): void |
+-------------------------------+
You must implement this the Die
class by the end of lab. Note the following:
- You must use an object from the
Random
class. We have not discussed this class in lecture, but you are expected to be able to read the Javadoc and figure out how to use it. This attribute must be declared asstatic
. - If you have any questions about the intended functionality, please ask your instructor.
Your program must:
- Make use of at least three different
Die
objects with at least two with a different number of sides. - Must clearly describe to the user how to use your program.
- Allow the user to repeatedly use the program without having to run it again.
You must submit a description of what your program will do by the beginning of lab (either via email or physically in lab).
Acknowledgement
This laboratory assignment was developed by Dr. Chris Taylor.