Question: c++ Description For this assignment, you will write a C++ program to simulate the Deal or No Deal game show. Your program will be console-based
c++
Description
For this assignment, you will write a C++ program to simulate the Deal or No Deal game show. Your program will be console-based (i.e. no graphics). To find out how the game is played, you can check out an online version of the game at http://www.crazygames.com/game/deal-or-no-deal. Your program should follow the rules of the game show. When the program is launched, it should first ask the user to choose one case; this case becomes the players case for the remainder of the game. The game then progresses in several rounds of play. In each round, the user is prompted to open (guess) a certain number of cases. After each case is opened, your program should display both the dollar amounts that are still in play and also the cases that remain unopened. After all the cases in a particular round have been opened, your program should display an offer for the user and ask for a deal or no deal response. If the user takes the deal then the game terminates immediately otherwise the game continues on to the next round. The number of cases to be opened in each round is based on the following chart
| Round | Cases |
| 1 | 6 |
| 2 | 5 |
| 3 | 4 |
| 4 | 3 |
| 5 | 2 |
| 6-9 | 1 |
If the user does not take the deal at the end of round nine, then she gets the option of either keeping her original case or switching it with the last remaining case. The users decision in this last round determines how much money she wins. Your program should print out a message showing the amount of money won by the user after the last round of play.
Implementation Instructions
- You should use a struct to represent each case and an array of structs to hold information about all 26 cases.
- You should use a random number generator to randomly assign dollar amounts to each case at the start of the game. Note, when generating numbers, you need to make sure that the same random value is not assigned to multiple cases.
- You have some flexibility in terms of what formula to use to generate the bank offers. A simple heuristic would be to use the average worth of the unopened cases.
- You should define several functions for this program. For example, the display of dollar amounts and cases, initialization of cases and the formula for computing the bank offer, should all go into separate functions.
- You should do some amount of error checking. In particular, if the user attempts to open a case outside the range of 1-26, your program should print an error message and ask for input again.
- You should not have any global variables in this program.
- Document your code. Give meaningful names to your variables
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
