Question: Using Java 1. Create a class called PairOfDice in Java 2. . Objects of this class represent a single pair of six-sided dice. The only

Using Java

1. Create a class called PairOfDice in Java

2. . Objects of this class represent a single pair of six-sided dice. The only attributes of such an object are the face values of the dice. Provide a constructor.

3.Provide a roll method that simulates rolling the dice

4.. Provide a value method that returns the sum of the face values of the dice. Provide a toString method that returns a nicely formatted string representing the pair of dice, for example 5 : 3 = 8. Finally, create a test driver class containing the main method that demonstrates that your PairOfDice class performs correctly

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!