Question: Code Needed In Java Please. Using the Die class you created in a previous lab, write a DieTester class with a main method that creates

 Code Needed In Java Please. Using the Die class you created

in a previous lab, write a DieTester class with a main method

that creates two die objects, rolls both dice print the value ofCode Needed In Java Please.

Using the Die class you created in a previous lab, write a DieTester class with a main method that creates two die objects, rolls both dice print the value of each die, store the sum of the roll in a variable, and prints the variable If the die have an equal value, then call a method named getMessage, with the sum as input(see below) and print the String returned Write a static method called getMessage that takes the sum (an integer) as input. The method returns a string corresponding to the table that corresponds to the given sum. SumMessage 2 I "Snake Eyes!" I"Four, the hard way!" 6 I "Hard Six!" I "Eight, the hard way!" I "Hard Ten" 10 12 "Box Cars!" other "Something went wrong" Example output for a roll of 12 with 2 sixes Die 1: 6 Die 2: 6 Sum: 12 Box Cars

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!