Question
Java You are going to write a program to play a round of Let's Make a deal. Run the program 20 times, always opting to
Java
You are going to write a program to play a round of "Let's Make a deal".
Run the program 20 times, always opting to swap doors. Run the program 20 times always opting to keep doors. What strategy seems to be the best?
Randomly printing out a set of booby prizes and good prizes. Allowing the user to play the game over AND over again without having to restart the program. Using functions. Writing the program such that the user has the option of playing normally, or playing a few thousand rounds automatically
LET'S MAKE A DEAL:
This is how "Let's Make A Deal" is played.
First of all, there are three doors. Randomly, behind one door, there is a good prize. The other two doors contain bad prizes. The technical term for a bad prize is "booby prize".
The contestant, or user, is asked to choose door number 1, 2 or 3.
Then, the user is shown one of the booby prize doors. Here, there are two cases. If the user selected the good door the first time, then one of the other two remaining booby prize doors are opened randomly. If the user selected a booby prize door, then the other booby prize door is opened.
Now we have two closed doors. One that was chosen by the user, and the one that was not opened. The user is then asked if he/she would like to switch doors.
Finally, the user's door is opened, either revealing a good prize or a booby prize.
Sample Output :
Welcome to LETS MAKE A DEAL!! Which door do you want to choose? Door number 1, 2 or 3? 2 Behind door 1 is a Booby prize! You have chosen door 2 Do you wish to switch to door 3 ? Enter 1 for yes, and zero otherwise 1 Your final choice is door 3 The good prize is located behind door 2 Ach, you got the Booby prize!
Welcome to LETS MAKE A DEAL!! Which door do you want to choose? Door number 1, 2 or 3? 1 Behind door 3 is a Booby prize! You have chosen door 1 Do you wish to switch to door 2 ? Enter 1 for yes, and zero otherwise 0 Your final choice is door 1 The good prize is located behind door 1 Congratulations! You won!
Welcome to LETS MAKE A DEAL!! Which door do you want to choose? Door number 1, 2 or 3? 2 Behind door 1 is a Booby prize! You have chosen door 2 Do you wish to switch to door 3 ? Enter 1 for yes, and zero otherwise 0 Your final choice is door 2 The good prize is located behind door 3 Ach, you got the Booby prize!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started