Question: Problem 2 . [ 3 5 points ] Roll Three Dice. Write a C + + function that simulates the outcome of rolling three dice

Problem 2.[35 points] Roll Three Dice. Write a C++ function that simulates the outcome of rolling three dice simultaneously. Each die is fair (with an equal probability of getting 1,2,3,4,5,6) and independent. For example, if the first die gets 2, the second die gets 4 and the third die gets 3, the function returns 9. Write a main function that calls the function and simulates 100003-dice rolls, and the function calculates and displays probability for the sum of three dice equals 3,3,4,dots,18.
Report your results in the write-up.
Submit your .cpp file as "yourLastName hw7 prob2.cpp".
Hint: We ask you to use vector to store the total number of rolls that gives the results of 3,3,4,dots,18. Declaring 16 separate variables is a bad idea.
Problem 2 . [ 3 5 points ] Roll Three Dice. Write

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 Programming Questions!