Problem

Suppose you roll a set of n dice. Then the smallest sum is n and the largest sum is 6n....

Suppose you roll a set of n dice. Then the smallest sum is n and the largest sum is 6n. For example, if n = 10, then the smallest sum is 6 and the largest sum is 60. Let m be the desired sum of the numbers rolled. Then n ≤ m ≤ 6n. If n = 10, then 6 ≤ m ≤ 60. Write a program that uses the class die, of Example 10-9, to roll 10 dice. (Use an array of size 10 to implement 10 dice.) The program prompts the user to enter the desired sum and the number of times the dice are to be rolled. The program outputs the number of times the desired sum was rolled and the probability of rolling the desired sum. Test run your program to roll the 10 dice 10,000, 100,000, 1,000,000, 10,000,000, and 100,000,000 times with the desired sums 6, 25, 40, and 60. How many times was the sum 6 rolled? How many times was the sum 60 rolled?

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT