Question: i need to write a C++ Program in microsoft visual studio 2. Write a program that simulates the rolling of two dice. The program should

 i need to write a C++ Program in microsoft visual studio
2. Write a program that simulates the rolling of two dice. The
i need to write a C++ Program in microsoft visual studio

2. Write a program that simulates the rolling of two dice. The program should use rand to roll the first die and should use rand again to roll the second die. The sum of the two values should then be calculated. (Note: Each die can show an integer value from 1 to 6, so the sum of the two values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 being the least frequent sums.) Figure 7.32 shows the 36 possible combinations of the two dice. Your program should roll the two dice 36,000 times. Use a one-dimensional array to tally the numbers of times each possible sum appears. Print the results in a tabular format. Also, determine if the totals are reasonable (.e, there are six ways to roll a 7, so approximately one-sixth of all the rolls should be 7). 1 2 3 4 5 6 2 2 3 4 5 6 7 3 4 5 6 7 8 4 5 6 7 8 9 4 5 6 7 8 9 10 S 6 7 8 9 10 11 10 11 12 6 7 8 9 Sampe Output Sum 2 3 4 5 6 Total Expected 983 2.778% 1918 5.556% 2952 8.333% 4138 11.111% 4964 13.889% 5952 16.667% 5062 13.889% 4007 11.111% 3071 8.333% 2007 5.556% 946 2.778% Actual 2.731% 5.328% 8.200% 11.494% 13.789% 16.533% 14.061% 11.131% 8.531% 5.575% 2.628% 8 10 11 12

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!