Question: (I need this in Dev-C++ ) For this portion of Lab #4, you will be combining the control statements and selection statements we have been

(I need this in Dev-C++ )

For this portion of Lab #4, you will be combining the control statements and selection statements we have been discussing to write a simple dice game. In this game, the player bets a certain quantity of money, and then wins or loses depending on the throw of the dice as follows:

Dice Throw: Original amount of money is:
6 or 12 Tripled
8 or 9 Doubled
7 or 11 Lost
all others no change

HINT: Remember the random number generator function that we explored in our number-guessing game. This game involves rolling a pair of six-sided dice, so you will need to generate two random numbers, each in the range 1 to 6, to represent the face values of each die. The sum of these two values is the value of the throw. With each turn, the program should prompt the player for the bet and then print the results, and it should also ask the player at the end of each turn if he or she wishes to play again.

Here is an example of what a completed game should look like:

GET READY TO PLAY THE DICE GAME! WHAT IS YOUR BET? 10 DICE THROW IS 5 NO CHANGE YOUR TOTAL WINNINGS ARE: $0.00 PLAY AGAIN? Y WHAT IS YOUR BET? 25 DICE THROW IS 7 YOU LOST! YOUR TOTAL WINNINGS ARE: -$25.00 PLAY AGAIN? Y WHAT IS YOUR BET? 25 DICE THROW IS 7 YOU LOST! YOUR TOTAL WINNINGS ARE: -$50.00 PLAY AGAIN? Y WHAT IS YOUR BET? 50 DICE THROW IS 8 YOU WIN! YOU DOUBLED YOUR BET! YOUR TOTAL WINNINGS ARE: $50.00 PLAY AGAIN? Y WHAT IS YOUR BET? 10 DICE THROW IS 5 NO CHANGE YOUR TOTAL WINNINGS ARE: $50.00 PLAY AGAIN? N

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!