Question: Chapter 3 Write a program that uses a function that returns a number between 1 and 6 . Use this function to simulate the roll
Chapter Write a program that uses a function that returns a number between and 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 Possible Totals Therefore, for example, the odds of a are : in any given roll. If you roll times then the expected outcome for a is So odds are that you will get a times. The odds you will get a are 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. Example Output: This program rolls two dice and tabulates the results. Please enter the number of rolls you want: Sum #Rolled Odds Error : : : : : : : : : : : Try again? Yes, ExitPlease enter the number of rolls you want: Sum #Rolled Odds Error : : : : : : : : : : : Try again? Yes, ExitPlease enter the number of rolls you want: Sum #Rolled Odds Error : : : : : : : : : : : Try again? Yes, ExitPlease enter the number of rolls you want: Sum #Rolled Odds Error : : : : : : : : : : : Try again? Yes, ExitPlease enter the number of rolls you want: Sum #Rolled Odds Error : : :
