Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi please give me a solution above with C++(Visaul studio 2019) Overview In this homework, you will implement a famous (but simple) game called the

image text in transcribed Hi please give me a solution above with C++(Visaul studio 2019)

Overview In this homework, you will implement a famous (but simple) game called the "Monty Hall problem," from the television show Let's Make a Deal The game involves the following situation the game host shows the player three doors, numbered 1 through 3, and tells the player that behind only one of the doors lies a great prize; the other two dou have goats behind them. The player picks one dout, and in response the host opens another door that he/she knows has a goat behind it. The host then asks the player if he/she would like to switch to the other unopened door. After this decision, the player opens their door and claims whatever lies behind it, be it goat or glorious prize. Game Rules 1. A door is chosen in secret (1, 2, or 3) to be the "winning door. Implicitly, the other doors have goats. 2. The user is asked to choose a door (1, 2, or 3). You do not need to verify their choice. 3. Another door is chosen to reveal to the player. The chosen door must have a goat behind it, and must not be the door that the player chose. 4. After revealing the door, the user is asked if they would like to switch to the only remaining other door. Their response will be a 'y' or 'n', inputted as a char variable. 5. Reveal whether the user won the game or not by comparing their final door choice to the secretly chosen winning door. (a) If the user loses, give them a sad message. (b) If the user wins, randomly choose one of five glorious prizes of your design. Randomly pick One of the five prizes and output a description of the prize. Requirements Your lab must follow these code requirements: . I recommend not using string variables, since they don't behave exactly the same as in Java and we haven't covered them yet. If you ignore this advice, at least make sure you #include . You must generate random numbers using the random> library's default_random_engine class, as shown in lecture. I don't care if your friend says you should do it another way. Deliverables Turn in the following when the homework is due: 1. A priated copy of your code, printed from your IDE when possible. If you cannot print from your editor, copy your code into Notepad or another program with a fixed-width (monospace) font and print from there. 2. A printout of your program's output showing four different runs through the program: (a) a run where the user does not switch and wins; (b) a run where the user switches and wins; (c) a run where the user does not switch and loses (d) a run where the user switches and loses

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions