Lets roll some dice! Write a program that allows the user to choose to roll between 1 and 100 dice between 1 and 1000 times. The program should simulate each roll of the die/dice by generating one random number in
Let’s roll some dice! Write a program that allows the user to choose to roll between 1 and 100 dice between 1 and 1000 times.
The program should simulate each roll of the die/dice by generating one random number in the range of possible values for the specified number of dice. For example: for 1 die generate one random number between 1 and 6; for 4 dice generate one random number between 4 and 24.
The program should use an array to keep count of the number of times each possible total is rolled. For example, if rolling 1 die the array values will represent how many times a 1 is rolled, how many times a 2 is rolled, how many times a 3 is rolled, how many times a 4 is rolled, how many times a 5 is rolled, how many times a 6 is rolled….if rolling 3 dice, the array values will represent how many times a 3 through 18 is rolled. (Note: the array does not store the values that are being rolled – instead each value in the array contains a count of how many times the value associated with the index has been rolled)
After all the rolls are complete the program should print the results in a histogram where each roll is represented by a *. The histogram should be printed to the screen and to a file. The program should contain a separate method that is used to print out the histogram.
Below the histogram, the program should print out a statement indicating which number or numbers was rolled the most. The program should contain a separate method to determine these results.
The user should be able to “play” as many times as they like.
- Expert Answer
Java Code Import java util class RandomDiceHistogram Public static void master argument View the full answer

Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Cannot find your solution?
Post a FREE question now and get an answer within minutes*.