Question: ThrowDie Program Write a JAVA program that simulates throwing a die n times. The program will read the number of times to throw the die

ThrowDie Program Write a JAVA 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.

Use for/while loops to write the program.

ThrowDie Program Write a JAVA program that simulates throwing a die n

1 How many times to throw a die?: Throw #1 20.0 31. 40.0 5 Throw #2 6... 7 0 8... 9 Throw #3 10 0.0 11 ... 12 0.0 13 Throw #4 14 ... 15 0 16 ... 17 Throw #5 18 0.0 19.0. 20 0.0 21 Throw #6 22 0.0 23.0. 24 0.0 25 Throw #7 260.. 27 ... 28 1.0 29 Throw #8 30 0.0 31 .0. 32 0.0 33 Throw #9 34 0.0 35 ... 36 0.0 37 Throw #10 38 0.0 39 .0. 40 0.0 41

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!