Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that simulates rolling two dice. Prompt the user to enter the number of dice rolls. Use a loop to repeatedly call a

Write a 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

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions

Question

find all matrices A (a) A = 13 (b) A + A = 213

Answered: 1 week ago