Write a program that simulates the rolling of two 6-sided


Write a program that simulates the rolling of two 6-sided dice. Use an Array to keep track of the number of times that each total number is thrown. In other words, keep track of how many times the combination of the two simulated dice is 2, how many times the combination is 3, and so on, all the way up through 12.

Allow the user to choose how many times the "dice" will be thrown. Then, once the dice have been thrown the specified number of times, print a histogram (using the * character) that shows the total percentage each number was rolled. Each * will represent 1% of the total rolls.


Sample session:

Welcome to the dice throwing simulator!
How many dice rolls would you like to simulate? 1000 DICE ROLLING SIMULATION RESULTS
Each "*" represents 1% of the total number of rolls. Total number of rolls = 1000.

2: ***
3: ***
4: ***********
5: ***********
6: ********
7: ******************
8: ****************
9: **********
10: *************
11: *****
12: **

Thank you for using the dice throwing simulator. Goodbye!

 

 

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a program that simulates the rolling of two 6-sided
Reference No:- TGS02386280

Now Priced at $15 (50% Discount)

Recommended (98%)

Rated (4.3/5)