Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please use basic C Q7. (20 points) (Dice Rolling) Write a program that simulates the rolling of two dice. The program should use rand to
please use basic C
Q7. (20 points) (Dice Rolling) 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: Since each die can show an integer value from 1 to 6, then the sum of the two values will vary from 2 to 12, with 7 being the most frequent sum and 2 and 12 the least frequent sums]. Following figure shows the 36 possible combinations of the two dice. Your program should roll the two dice 36,000 times. Use a single-subscripted 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; i.e., there are six ways to roll a 7, so approximately one-sixth of all the rolls should be 7. 1 23 45 6 7 3 45 6 789 45 67 8 910 5 6 7 8 9 10 11 6 7 8 9 10 11 12 Please submit a repl.it url link for your programStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started