Question: Write a program that simulates rolling two dice using the following steps: 1. Prompt the user for the number of sides for two dice. 2.

 Write a program that simulates rolling two dice using the following

Write a program that simulates rolling two dice using the following steps: 1. Prompt the user for the number of sides for two dice. 2. "Roll" the dice three times by generating a random number between 1 (inclusive) and the number of sides (inclusive) 3. Keep track of the sum of the rolls for each die and output the sum and average for each die. Total possible points: 11 points: a) Prompt the user for the side of each die (3 points) b) Proper use of Random number generation (3 points) c) Sum of the rolls for each die (2 points) d) Average of the rolls for each die (2 points) e) Formatted Output (1 point) Sample Output: How many sides does die 1 have? 6 How many sides does die 2 have? 20 Die I first roll 5. Die 2 first ro11 14. Die 1 sec nd roll = 1. Die 2 second roll 20 Die 1 third roll 3. Die 2 third roll- 9. Die 1 rolled a total of 9 and rolled 3 on average Die 2 rolled a total of 43 and rolled 14.333 on average

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!