Suppose you roll a set of n dice. Then the smallest sum is n and the largest sum is 6n. For example, if 510 n , then the smallest sum is 6 and the largest sum is 60. Let m be the desired sum of the...


Suppose you roll a set of n dice. Then the smallest sum is n and the largest sum is 6n. For example, if 510 n , 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 510 n , 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 10000, 100000, 1000000, 10000000, and 100000000 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?




May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here