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 $1. The player may buy as many rolls as desired.
The two die numbers (each 1-6) are randomly generated for each roll.
The player wins when they roll a double (i.e., two of a kind). The prize is the face value of the dice
in dollars. For example, two sixes will win the player $12.
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 #1(WINNING SCENARIO - FIVE ROLLS ($5 cost) AND a $10 WIN)
Step right up to play LUCKY DOUBLES !!!!
One roll of the dice costs $1.00.
If you roll ** LUCKY DOUBLES**, you'll win the FACE VALUE of your dice in $$.
Ready? Enter number of rolls: 5
Die1 is 3 and die2 is 4. No luck here.
Die1 is 1 and die2 is 3. No luck here.
Die1 is 5 and die2 is 5.! YOU WON $10.00!! CONGRATULATIONS!
Die1 is 1 and die2 is 4. No luck here.
Die1 is 2 and die2 is 1. No luck here.
Your final total is $5.00. Congratulations! You came out ahead!
SAMPLE RUN #2(LOSING SCENARIO - TEN ROLLS ($10 COST) AND ONLY A SINGLE $2 WIN):
Step right up to play LUCKY DOUBLES !!!
One roll of the dice costs $1.00.
If you roll , you'll win the FACE VALUE of your dice in $$.
Ready? Enter number of rolls: 10
Die1 is 4 and die 2 is 3. No luck here.
Die 1 is 6 and die 2 is 1. No luck here.
Die1 is 5 and die 2 is 1. No luck here.
Die1 is 4 and die2 is 1. No luck here.
Die1 is 4 and die2 is 5. No luck here.
Die1 is 1 and die2 is 4. No luck here.
Die1 is 5 and die2 is 3. No luck here.
Die 1 is 1 and die 2 is 1.?**** LUCKY DOUBLES*?****! YOU WON $2.00!! CONGRATULATIONS!
Die 1 is 4 and die 2 is 5. No luck here.
Die1 is 2 and die2 is 1. No luck here.
Your final total is $-8.00. Sorry, but the house always wins.
 Code the Lucky Doubles dice game as shown in the three

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!