Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

program Write a program that simulates the rolling of two dice. The program should use rand twice to roll the first die and second die,

program
image text in transcribed
Write a program that simulates the rolling of two dice. The program should use rand twice to roll the first die and second die, respectively. The sum of the two values should then be calculated. [Note: Because each die can show an integer value from 1 to 6 , then the sum of the two values will vary from 2 to 12 , with 7 being the most frequent sum and 2 and 12 the least frequent sums. ] Figure below shows the 36 possible combinations of the two dice. Your program should roll the two dice 36,000 times. Use a onedimensional array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also, determine if the totals are masonable; i.. , there are six ways to roll a 7 , so approximately one-sixth of all the rolls should be 7

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 Systems For Advanced Applications Dasfaa 2023 International Workshops Bdms 2023 Bdqm 2023 Gdma 2023 Bundlers 2023 Tianjin China April 17 20 2023 Proceedings Lncs 13922

Authors: Amr El Abbadi ,Gillian Dobbie ,Zhiyong Feng ,Lu Chen ,Xiaohui Tao ,Yingxia Shao ,Hongzhi Yin

1st Edition

3031354141, 978-3031354144

More Books

Students also viewed these Databases questions

Question

1. Identify three communication approaches to identity.

Answered: 1 week ago

Question

d. Who are important leaders and heroes of the group?

Answered: 1 week ago

Question

3. Describe phases of minority identity development.

Answered: 1 week ago