Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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. If 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 or they 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! have 100 tokens. You Would you like to play? Enter Y to pull or enter N to end [Y/N] Y [31 [2] [2] Sorry you lose You have 99 tokens. Enter Y to pull again or enter N to end [Y/N]: y You have won 4 tokens! You have 102 tokens Enter Y to pull again or enter N to end [Y/N]: y [11 [31 [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
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