Question: Chapter 3 in C + + Write a program that uses a function that returns a number between 1 and 6 . Use this function

Chapter 3
in C++ Write a program that uses a function that returns a number between 1 and 6. Use this function to simulate the roll of a die. Allow the user to specify the number of trials and then tabulate that number of rolls of two dice. The program must allow for repeated simulations. Initialize rand() using srand() and time().
Possible Outcomes for any roll
111213141516
212223242526
313233343536
414243444546
515253545556
616263646566
Possible Totals
234567
345678
456789
5678910
67891011
789101112
Therefore, for example, the odds of a 7 are 6:36 in any given roll.
If you roll 36 times then the expected outcome for a 7 is 6. So odds are that you will get a 7,6 times. The odds you will get a 2 are 1. Tabulate the difference between the expected outcome (odds) and the random number generator outcome list this as error.
In general, you should notice a decrease in error with more trials.
 Chapter 3 in C++ Write a program that uses a function

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!