Additional Instructions:
CIS 166 – Java ProgrammingProfessor RodriguesSlot MachineSlot Machine SimulationA slot machine is a gambling device into which the user inserts money, then pulls a lever (or presses a button). The slot machine then displays a set of random images. If two or more of the images match, the user wins an amount of money that the slot machine dispenses back to the user.For this assignment, you are to create a JavaFX application that simulates a slot machine, it should look similar to the screenshot belowThe application should let the user enter into a TextField control the amount of money he or she is inserting into the machine. When the user clicks the Spin button, the application should display 3 randomly selected symbols. (The images are attached on Blackboard). The program should also display the amount that the user won for the spin, and the total amount won for all spins.The amount won for an individual spin will be determined as follow:· If none of the randomly displayed images match, the user has won $0.· If two of the images match, the user has won two times the amount entered.· If three of the images match, the user has won six times the amount entered.Extra Credit:Modify the program so that the user starts with $1000 dollars, and loses money (or gains money) each time they play. Keep track of their balance, and prevent them from playing if their balance reaches 0. Also do not let them bid more than they have.Commenting and Programming StyleThe first 3 lines of you program should have a multiline comment (Starting with /* and ending with */). This should include the author’s name, the date and the purpose of the assignment.You should create a documentation comment before every class header and method header (Starting with /** and ending with */). For now, the comment only needs to describe the purpose of the method. We will improve our comments throughout the semester. A sample is provided below.Don’t forget to add spaces before and after every operator and to align braces. Within the start method and functions use single lines comments to explain what you are doing throughout the program.Submission and Grading:Submit all your java files and the UML diagram through Blackboard. You can compress the files if you want.Your grade will be determined based on the following rubric: Task Points Proper Setup of images 10 points Proper Controls created 10 points Proper Layout Container 10 points Proper Scene 10 points Proper Stage set up 10 points Proper Event handler to modify images and labels 10 points Proper Randomization and game logic 30 points Documentation & Style 10 points Total 100 pointsPenaltiesIf the program does not compile or run, 30 points will be deducted from your total.It is very important to test your program!
Gui Code Java
Slot Machine Java Guide
One for each reel of our Slot Machine. We create a static randomLong method to return a random long value between lower and upper values passed in parameters. In the onCreate method we set an OnClickListener object on the button used to launch or stop the Slot Machine. We wheck the state of the Slot Machine stored in the isStarted boolean property. This slot game I was playing on my phone was really simple. It had only 3 slots with different items in each. You had to push the Spin button in order to spin the slots, and you would win a small amount of coins if two or three slots were alike. Of course, 3 slots were better than 2. Hi there, as one of my first programs in java, I thought I will do a simple (!) lottery program.needless to say it doesn't compile, and after.