Question: Write a Java FX program that simulates playing a slot machine. Your program should provide the user with an initial stake of 50 dollars and
Write a Java FX program that simulates playing a slot machine. Your program should provide the user with an initial stake of 50 dollars and then let the user play until either the money runs out or the user decides to quit. During each round, your program should take away a dollar, simulate the spinning of the wheels, evaluate the result, and pay the user any appropriate winnings. Even though doing so is not realistic, you should assume that each of the six symbols is equally likely on each wheel. The run below is a text-based example. You can use it help test your solution-graphically. Set the title to Slots!! and center the stage on the screen. Place all classes into one file. Sample Run: Welcome to Slots!! You have $50. Would you like to play (Y/N)? Y PLUM LEMON LEMON You Lose You have $49. Would you like to play (Y/N)? Y PLUM BAR LEMON You Lose You have $48. Would you like to play (Y/N)? y BELL LEMON ORANGE You Lose You have $47. Would you like to play (Y/N)? y CHERRY CHERRY ORANGE You Win $5 You have $51. Would you like to play (Y/N)? Y LEMON ORANGE BAR You Lose You have $50. Would you like to play (Y/N)? Y PLUM BELL PLUM You Lose You have $49. Would you like to play (Y/N)? y BELL BELL BELL You Win $20 You have $68. Would you like to play (Y/N)? n With comments
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
