A slot machine has three wheels that have pictures of various fruit on them (BANANA, ORANGE, RAISIN, CHERRY). A player inserts 1, 2, 3 or 4 dollars as his or her "bet". A player then spins the three wheels. If the player's spin results in a pair (two fruit are the same), then the player wins 5 times the bet. If the player's spin results in a triple (all wheels display the same fruit), then the player wins 50 times the bet. The slot machine will allow the player to spin the wheels 5 times. After each spin, show the amount won and the total winnings so far.
Download a copy of the SlotMachine.zip project and uncompress it. Move this folder into the workspace on your desktop.
Use the following sample run to get an idea of how the program should work and what your output should look like. Note that since the slot wheels are random, you will probably not get this output exactly.
Welcome to the SLOT MACHINE! Your total winnings = $0 How many dollars do you want to bet (1-4)? 2 You spun: CHERRY RAISIN BANANA Sorry, you do not win any money. Your total winnings = $0 How many dollars do you want to bet (1-4)? 0 Error: Invalid Bet How many dollars do you want to bet (1-4)? 3 You spun: RAISIN ORANGE ORANGE You win $15! Your total winnings = $15 How many dollars do you want to bet (1-4)? 4 You spun: CHERRY CHERRY CHERRY You win $200! Your total winnings = $215 How many dollars do you want to bet (1-4)? -3 Error: Invalid Bet How many dollars do you want to bet (1-4)? 9 Error: Invalid Bet How many dollars do you want to bet (1-4)? 1 You spun: BANANA ORANGE RAISIN Sorry, you do not win any money. Your total winnings = $215 How many dollars do you want to bet (1-4)? 4 You spun: RAISIN BANANA RAISIN You win $20! Your total winnings = $235 THANK YOU FOR PLAYING THE SLOT MACHINE!