Question
Write a program that calls the random number generator two times to simulate rolling a pair of dice. It should store the two numbers into
Write a program that calls the random number generator two times to simulate rolling a pair of dice. It should store the two numbers into variables. It will then determine if the dice roll is a winner (doubles OR add up to 7). Remember to add two includes and also to seed the random number generator to the clock.
This will roll two dice and add them together.
Doubles, or a total of 7 - YOU ARE A WINNER!!!
First dice: 4
Second dice: 2
BETTER LUCK NEXT TIME
Sample output 2 is given below.
This will roll two dice and add them together.
Doubles, or a total of 7 - YOU ARE A WINNER!!!
First dice: 1
Second dice: 1
YOU WON!!!!
Sample output 3 is given below.
This will roll two dice and add them together.
Doubles, or a total of 7 - YOU ARE A WINNER!!!
First dice: 4
Second dice: 3
YOU WON!!!!
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