Reference no: EM132210439
How to write this program in Java.
1) Create a Dice class with a constructor that accepts number of dice to be thrown:
a. 1 dice will return 1-6
b. 2 dices will return 2-12
c. 3 dices will return 3-18
This Dice Class should also have a SetDices method to allow the user to change the number of dices, and a Roll method to get the random number, and a Value method to return the most recent random number generated.
2) Enhance Dice class with the Roll method should store up to 100 random number generated.
Add a History method should return the string that has all the generated numbers.
3) Write a test program to test the Dice class
a. Ask users to enter number of Dice.
b. Allow the user to guess until they get the correct number
c. Ask if user want to play again
d. Demonstrate use of Constructor
4) Improve the test program to print out the history of the random number generated.
5) Override the toString method of the Dice class and demonstrate its usage in the test program