Question: Please answer using Java and using normal public classes residing in individual java files. In this assignment you write a Java program that rolls two

Please answer using Java and using normal public classes residing in individual java files.


In this assignment you write a Java program that rolls two dice and displays the results. First, ask the user
Have a Java class encapsulating the functionality of a die. The die should be configurable according to the

In this assignment you write a Java program that rolls two dice and displays the results. First, ask the user about the type of dice they want to roll. For example, traditional die that looks like a cube has six sides. Alternatively, there could be many other types of dice -- 4, 6, 8, 12-sided, and so on: 12 20 8 8 6. Have your program ask the user how many sides they want on a die. Make sure to validate the user input. Decide what should be the minimal and maximum number of sides allowed. In a loop, ask the user if they want to roll the dice. If the answer is anything but "Y" or "y", exit the program.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Based on the assignment description you will need to create two Java classes one to represent a die and another to represent a pair of dice The Die cl... View full answer

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 Programming Questions!