Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

Dice Write a program that simulates rolling one die using the following steps: Prompt the user for the number of sides on the die.

DiceWrite a program that simulates rolling one die using the following steps:1.Prompt the user for the number of sides on the die.2."Roll" the die three times by generating a random number between 1 (inclusive) and the number of sides (inclusive).3.Keep track of the running sum of the rolls for the die and output the sum and average for the three rolls at the end.4.You can set up one integer variable named roll, and reuse it with each roll of the die. You will also need a variable named total, initialized to zero.Sample Output:How many sides on die? 6First roll = 5Second roll = 1Third roll = 3Die total = 9 Average roll = 3 How many sides on die? 20First roll = 14Second roll = 20Third roll = 9Die total = 43 Average roll = 14.333

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question