Question: Create a class called Dice which can be used to create dice for use in any application: Here are descriptions of all the members that

Create a class called Dice which can be used to create dice for use in any application:

Create a class called Dice which can be used to create dice

Here are descriptions of all the members that you will need to implement in the Dice class Dice member descriptiorn stores one of the two dies stores the other die constructor which returns a new pair of dice, initialized to 1 rivate int diel State rivate int die2 public Dice () public void roll () public int getTotal ) public String toString () and 1 rolls the dice (randomly) to change the values of the two dies s the total value of the two dies Behaviour returns a string representing the current state of the dice like s: "(diel, die2)" returns -1 if total ofthis Dice object is less than total of rhs, public int compareTo (Dice rhs) or +1 if total of this is greater than total of rhs, or o if totals are the same Do not implement any other members in the Dice class. Part of this assignment is to exactly follow the above specifications. ram (TestDice.java) of vour own to make sure that all implemented methods as specified Then write a test above are properlv behaved before we use the Dice class for the NewCraps game next

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!