Question: Please in Java thanks Create a class called D ie that simulates a single six-sided die. A die can have the values from 1 to
Please in Java thanks
Create a class called Die that simulates a single six-sided die. A die can have the values from 1 to 6. The constructor should set the die to a random value (i.e. the die should never start with the value of zero). It should have two methods. One called roll that randomly sets the die to a new value. And the other called value that returns the current value of the die.
Create a second class called Game that holds five dice objects. Have a method called roll that rolls all five dice. Have a method called print that gives the displays the values of each of the five dice on a single line with a space between the values.
Your main class should roll the five dice, display the result, and then ask the user if he wants to roll the dice again.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
