Question: JAVA PROGRAMMING Write a program that simulates a simple slot machine. The user starts with 100 tokens and each time he/she pulls the handle they


JAVA PROGRAMMING
Write a program that simulates a simple slot machine. The user starts with 100 tokens and each time he/she pulls the handle they use a token. The computer spins three wheels that contain the numbers 1, 2 and 3. lf all three wheels stop on the same number the player wins. For three 3's the player wins 12 tokens. For three 2's the player wins 8 tokens. For three 1's the player wins 4 tokens. The game ends when the player runs out of tokens orthey choose to stop pulling the handle on the slot machine Two sample runs of a program that satisfies the requirements of this problem are shown below. Sample Output 1: WELCOME TO THE TRIO SLOT MACHINE You have 100 tokens Would you like to play? Enter Y to pull or enter N to end [Y/N] Y [3] [2] [2] sorry you lose. You have 99 tokens. Enter Y to pull again or enter N to end [Y/N]: y [1] [1] [1] You have won 4 tokens! You have 102 tokens. Enter Y to pull again or enter N to end [Y/N]: y [1] [3] [2] Sorry you lose. You have 101 tokens Enter Y to pull again or enter N to end [Y/N]: n Thanks for playing! Come play again soon
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
