Question: Python.... 3. The Switch or Stay Game is the following game: There are 3 cards, where one says Winner and the other two say Loser.
Python....
3. The Switch or Stay Game is the following game: There are 3 cards, where one says Winner and the other two say Loser. The dealer places them randomly facedown, so the player cannot see what is written on them, but the dealer knows where the Winner is. The player chooses a card, leaving it facedown. The the dealer turns over one of the other two cards, making sure she turns over a Loser (since she knows where it is, she can do this). Then the player keeps his original card or switches to the other card that was not yet turned over. The player wins if he ends up with the Winner. Our goal is to write a program in which the user is prompted for a strategy as a string of Ss and W (Example: SWSSWWW). The program will then simulate the switch/stay game one time for each letter, where an S means the player will stay with his original choice, and a W means he will switch. At the end of simulating all the games, the program should nicely report on the outcome, i.e. at least indicating the number of games played and the percentage of wins. In the above example (with input SWSSWWW), the program will simulate one game in which the player stays, then a game in which he switches, and so on. Then the program will print out the results of the simulations. Note: In order to keep the printout from being too large, just print out the final result of the simulation; do not print out the result of each step. (a) Before doing anything, what is your guess: Should the player stay, switch, or does it not matter? (b) Write a design specification for your program. This should contain no code, and not even any pseudo code. It should just precisely describe what the program will do. Use a program like microsoft word or some text editor to do this. (c) Your goal is to create an object oriented program. In fact you must have a Give a complete design for the program using a UML class diagram. You should include at least one class that deals with the 3 cards and another class that keeps track of the statistics of the game results. (d) NOW ... You submit the above 3 items BEFORE going on to the program. When you get my OK, then, and only then, go on to the next step!! (so think hard before submitting the above 3 items) (e) Now write the program, following your design.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
