Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is java Write a java program that simulates rolling two dice. Prompt the user to enter the number of dice rolls. Use a loop
This is java
Write a java program that simulates rolling two dice. Prompt the user to enter the number of dice rolls. Use a loop to repeatedly call a method that simulates a dice roll and returns the total of the two dice to main. Keep track of the rolls in an array in main, and end the program by showing the results of the rolls.
How many times should I roll the dice? 1 How many times should I roll the dice? 100ee8 2 Results of 100 dice rolls 2 was rolled 4 times 3 was rolled 2 times 4 was rolled 1 times 5 was rolled 8 times 6 was rolled 15 times 7 was rolled 16 times 8 was rolled 17 times 9 was rolled 18 times 10 was rolled 10 times 11 was rolled 6 times 12 was rolled 3 times Results of 100000 dice rolls 2 was rolled 2820 times 3 was rolled 5624 times 4 was rolled 8185 times 5 was rolled 11160 times 6 was rolled 13914 times 7 was rolled 16632 times 8 was rolled 13811 times 9 was rolled 11152 times 10 was rolled 8376 times 11 was rolled 5502 times 12 was rolled 2824 times 5Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started