Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions