Question: Design and implement a graphical application that displays a slot machine and plays the game, interacting with the user. The final choice of color and
Design and implement a graphical application that displays a slot machine and plays the game, interacting with the user. The final choice of color and specific layout is left up to you, but you are to try to mimic my example (as below) layout of the items and display and interaction areas.
Use a circle, vertical rectangle, horizontal rectangle and triangle as the 4 types of shapes that can be displayed in the machine. When the program is ran, three of these objects are randomly selected and drawn side by side, as shown below in the top row, in your color choice. Provide an interface for the user so that the user can pick among the four objects using a button for each displayed object (three buttons total for the three objects), as shown below in the bottom row. After the user selects the three objects of choice and clicks on the Spin button, the program randomly re-generates the objects in the top row and compares them to the selections made by the user. After every repetition indicate whether it was a match or a mismatch. The choice of this indication is left to you; it can be either in a graphical or text format (not using the print but graphically). I have used a statement on the top of the display. You could also change the background of the background to a red color if it was a loss and green if it was a win. Make sure that the machine keeps on prompting the user with choices, until the Exit button is pressed on the JFrame.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
