Question: JAVA LOOPS (Java Eclipse) ThrowDie Program Write a program that simulates throwing a die n times. The program will read the number of times to
JAVA LOOPS (Java Eclipse)
ThrowDie Program Write a program that simulates throwing a die n times. The program will read the number of times to throw the die and display the throws. Each throw is represented by 9 characters where we use 0 or . (see sample run below). To generate random values, you need to create a Random object with a seed value that corresponds to the number of dies to throw. Use the method nextInt (with 6 as the argument) in order to generate integer random values between 0 and 5; just add 1 to the result to generate the die face. The following example illustrates the messages to use to read data and to display results.
(Please use "if" and "else if" to represent face value instead of "case" or break if that's possible)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
