Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Your Task Code the Lucky Doubles dice gome as shown in the three sample runs shown below. Here are the basic rules of the game:
Your Task
Code the Lucky Doubles dice gome as shown in the three sample runs shown below.
Here are the basic rules of the game:
One roll of the pair of dice costs The player may buy as many rolls as desired
The two die numbers each are randomly generated for each roll.
The player wins when they roll a double ie two of a kind The prize is the foce value of the dice
In dollars. For example, two slxes will win the plaver
Your game will report all rolls to the player and kees track of the plaver's money tocal.
Use s loop to execute the proper number of rolls.
Below are three sample runs to demonstrate game behavior. User input is highlighted in yellow to
distineuish between input and output.
SAMPLE RUN #WINHING SCEMARIO FIVE ROLLS cost AND a $ WIN
Step right up to plav LUCKY DOUBLES IIII
One roll of the dise costs $
One roll of the dice costs S If you roll you'll win the FACE VALUE of your dice in SS
Resdy? Enter number of rolls:
Die is and die is No luck here
Die is and die is No luck here.
Die is and die is YOU WON $ CONGRATULATIONS!
Die is and die is No luck here.
Die is and die is No luck here.
Your final tatal is $ Congratulationsi You came out ahesd
SAMPLE RUN $LOIHG SCEMARUO TEN ROLLS COT AND ONLY A SINGLE $ WIN:
One roll of the dice costs
One roll of the dice casts $ If you roll you'll win the FACE VALUE of your dise in $
Ready? Enter number of rolls:
Die is and die is No luck here.
Died is and diez is No luck here
Die is and die is No luck here
Your final total is $ You broke even.
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