Question: JAVA PROGRAM Write a program named roll.java that simulates rolling a pair of dice 10,000 times. It should track how many times each number (total

JAVA PROGRAM

Write a program named roll.java that simulates rolling a pair of dice 10,000 times. It should track how many times each number (total of dice 2 - 12) is rolled. Total On Dice Number of Rolls ------------- --------------- 2 274 3 520 . . . . . . 12 281

Hint: Create a 13 element int arrary to store the number of rolls of each value 2 - 12. Create a loop that executes 10,000 times. Inside the loop, pick 2 random numbers 1-6. Add the 2 numbers and increment to corresponding array element. After the main loop, output the values of array elements 2 - 12.

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!