



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Slot Machine Assignment (6) (Copy and paste when necessary) SlotMachine.java /* File: SlotMachine.java
// String that stores the three slot numbers String slots = "Numbers Entered: " + slot1 + ", " + slot2 + ", & "
if (same3Slots()) // If I have the same 3 slot numbers, { int prize = (100 * wager) ; // Then this is the amount that I won! receipt = "Congratulations! You have won the jackpot! You won: $"
/* File: SlotMachineTest.java
@ Name (§U0#) Numbers Entered: 9, 8, & 7 Amount wagered: $ Congratulations! You have won a prize! You won: $100! Also, reclaim your wager of: $ Remember that consecutive numbers can be in any order, this is why I changed the ratio from 60 : 1 to 20 : 1 as instructed. BUILD SUCCESSFUL (total time: 0 seconds) / / Output for E. @ Name (§U0#) Numbers Entered: 5, 3, & 4 Amount wagered: $ Congratulations! You have won a prize! You won: $100! Also, reclaim your wager of: $ Remember that consecutive numbers can be in any order, this is why I changed the ratio from 60 : 1 to 20 : 1 as instructed. BUILD SUCCESSFUL (total time: 0 seconds) / / Output for F. @ Name (§U0#) Numbers Entered: 8, 9, & 10 Amount wagered: $ Sorry, you mistyped your values. Please type them correctly to play again, or else... NaN BUILD SUCCESSFUL (total time: 0 seconds) / / Output for G. @ Name (§U0#) Numbers Entered: 5, 6, & 0 Amount wagered: $ Sorry, you lost your wager; please enter your wager to play again. BUILD SUCCESSFUL (total time: 0 seconds) */