Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

Explain the functions of financial management.

Answered: 1 week ago

Question

HOW MANY TOTAL WORLD WAR?

Answered: 1 week ago

Question

Discuss the scope of financial management.

Answered: 1 week ago

Question

Discuss the goals of financial management.

Answered: 1 week ago

Question

=+5 Does this case provide an example of the future for IHRM?

Answered: 1 week ago

Question

=+4 How did it affect HR?

Answered: 1 week ago