Question: JAVA. Please read the code carefully and only solve for the two problems in the YELLOW box. /* * The class PairofDice implements some basic

JAVA. Please read the code carefully and only solve for the two problems in the YELLOW box.

JAVA. Please read the code carefully and only solve for the two

/* * The class PairofDice implements some basic functionality * of a pair of dice. You may not add any methods to this class * other than those indicated below. */ public class PairofDice { private int diei, die2; // constructor public PairofDice() { rollo; public void roll() { //_randomize the dice values die1 = StdRandom.uniform(1, 7), Il returns a random number from 1 to 6 die2 = StdRandom.uniform(1, 7); public boolean isDoubles() { il determines if the two die values are the name return die1 == die2; public int sum() { // the the sum of the two die values return die1 + die2; 11 ToDo 1 Il add an instance method that determines if the current dice sum is 7 or 11 /return true or false 11 ToDo 2 // add an instance method that determines if both dice are odd. | 11 hint boolean

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is the solution to the two ToDo tasks in the yellow box in the provided code ToDo 1 Method to d... 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 Databases Questions!