C
cb17890
Hi I'm new to JAVA Programming and need help with my homework!
The assignment: Design and implement a simple, well-documented JAVA
program that uses random numbers to simulate throwing a pair of dice
and recording the total score thrown. That is, each roll will throw
two dice, each of which can randomly result in a face up value of 1,
2, 3, 4, 5, or 6. The program should add the two values to get a
score for the roll. The score will be between 2(1+1) and 12(6+6).
The program should loop to roll the dice a total of 500 times and
should sum up how many times each score was thrown. That is, how many
of the 500 times was a total of 2 thrown, how many times was a total
of 3 thrown, etc. You will need one accumulator for each of the 11
possible scores. Afer all 500 rolls have been thrown and counted, the
program should report for each possible score (2-12), how many times
it was thrown and what % of the time it was thrown. This program
will have no input. It should produce output similar to the
following:
Total Number Percent
Rolled of Times of Time
So far, I know to use the for loop with the following values: (count =
2; count <= 500; count++) but then I'm stuck. I don't know what to do
next!!
The assignment: Design and implement a simple, well-documented JAVA
program that uses random numbers to simulate throwing a pair of dice
and recording the total score thrown. That is, each roll will throw
two dice, each of which can randomly result in a face up value of 1,
2, 3, 4, 5, or 6. The program should add the two values to get a
score for the roll. The score will be between 2(1+1) and 12(6+6).
The program should loop to roll the dice a total of 500 times and
should sum up how many times each score was thrown. That is, how many
of the 500 times was a total of 2 thrown, how many times was a total
of 3 thrown, etc. You will need one accumulator for each of the 11
possible scores. Afer all 500 rolls have been thrown and counted, the
program should report for each possible score (2-12), how many times
it was thrown and what % of the time it was thrown. This program
will have no input. It should produce output similar to the
following:
Total Number Percent
Rolled of Times of Time
So far, I know to use the for loop with the following values: (count =
2; count <= 500; count++) but then I'm stuck. I don't know what to do
next!!