Slot Machine Challenge

advertisement
Slot Machine
Create an application called (SlotMachine.java) that simulates a simple slot machine in which three
numbers between 0 and 9 are randomly generated and printed side by side. If all three numbers are the
same print “Jackpot!”, if only two of the three are the same print “matched 2!”. Allow the user to enter
a sentinel value to stop the game from running.
Play the simple slot machine. To continue
playing enter ANY positive number. To stop
playing enter a negative 1.
User would enter this
input….
Wanna play? : 1
Slot 1: 6
Slot 2: 4
Slot 3: 6
Matched 2!
Wanna play? : 1
Slot 1: 1
Slot 2: 9
Slot 3: 4
Sorry.
Wanna play? : 1
Slot 1: 3
Slot 2: 3
Jackpot!
Wanna play? : -1
Thanks for playing!
Slot 3: 3
Download