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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!