Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a C program to simulate rolling two dice 100 times. In an array, record the random totals from each roll of the two dice.
Create a C program to simulate rolling two dice 100 times. In an array, record the random totals from each roll of the two dice. Using a second array print out the number of times each possible total was rolled. Sample output is the following:
\begin{tabular}{rrrrrrrrrr} 9 & 7 & 9 & 5 & 4 & 8 & 9 & 4 & 7 & 6 \\ 4 & 5 & 5 & 11 & 8 & 9 & 5 & 10 & 5 & 9 \\ 4 & 8 & 4 & 6 & 12 & 5 & 7 & 9 & 5 & 7 \\ 6 & 6 & 9 & 9 & 5 & 8 & 6 & 5 & 7 & 6 \\ 4 & 5 & 12 & 4 & 8 & 6 & 7 & 7 & 6 & 8 \\ 10 & 3 & 3 & 11 & 4 & 4 & 7 & 6 & 6 & 6 \\ 10 & 7 & 5 & 9 & 9 & 9 & 10 & 8 & 11 & 6 \\ 3 & 5 & 3 & 8 & 5 & 7 & 7 & 4 & 8 & 9 \\ 3 & 8 & 9 & 6 & 6 & 11 & 8 & 10 & 12 & 5 \\ 6 & 2 & 6 & 5 & 8 & 6 & 7 & 7 & 5 & 11 \\ Total & Frequency & & & & & & & \\ \hline 2 & & 1 & & & & & & & \\ 3 & & 5 & & & & & & & \\ 4 & & 10 & & & & & & & \\ 5 & & 16 & & & & & & & \\ 6 & & 17 & & & & & & & \\ 7 & & 13 & & & & & & & \\ 8 & & 12 & & & & & & & \\ 9 & & 13 & & & & & & & \\ 10 & & 5 & & & & & & & \\ 11 & & 5 & & & & & & & \\ 12 & & 3 & & & & & & & \end{tabular}Step 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