Question: Code the Lucky Doubles dice game as shown in the three sample runs shown below. Here are the basic rules of the game: One roll
Code the Lucky Doubles dice game 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 face value of the dice
in dollars. For example, two sixes will win the player $
Your game will report all rolls to the player and keep track of the player's money total.
Use a loop to execute the proper number of rolls.
Below are three sample runs to demonstrate game behavior. User input is highlighted in yellow to
distinguish between input and output.
SAMPLE RUN #WINNING SCENARIO FIVE ROLLS $ cost AND a $ WIN
Step right up to play LUCKY DOUBLES
One roll of the dice costs $
If you roll LUCKY DOUBLES you'll win the FACE VALUE of your dice in $$
Ready? 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 total is $ Congratulations! You came out ahead!
SAMPLE RUN #LOSING SCENARIO TEN ROLLS $ COST AND ONLY A SINGLE $ WIN:
Step right up to play LUCKY DOUBLES
One roll of the dice costs $
If you roll you'll win the FACE VALUE of your dice in $$
Ready? 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 No luck here.
Die is and die is No luck here.
Die is and die is No luck here.
Die is and die is No luck here.
Die is and die is No luck here.
Die is and die is LUCKY DOUBLES YOU WON $ CONGRATULATIONS!
Die is and die is No luck here.
Die is and die is No luck here.
Your final total is $ Sorry, but the house always wins.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
