Question: JavaScript i. ii. iii. iv. V. vi. j. [6 marks] Function tallyOnePlay(). No parameters. This function completes one play of the slot machine as follows:

JavaScript

JavaScript i. ii. iii. iv. V. vi. j. [6 marks] Function tallyOnePlay().

i. ii. iii. iv. V. vi. j. [6 marks] Function tallyOnePlay(). No parameters. This function completes one play of the slot machine as follows: Stop the scheduled every 50 ms) function rollslots() from occurring. Set the currentWin value by using calculatePayout(). Add the currentWin value to the currentCredits. Update the play statistics (refer to updatePlayStats(). Invoke updateWinner() as needed. Enable all three buttons ("Place Bet of 1 Credit, Place Bet of 3 Credits, and Play Me Now!") k. [1 mark] Event handler for Play Me Now!" button (with id btnPlay). If the user has enough credits to play, invokes the scheduleOnePlay() function. I. [4 marks] Add to/modify the existing code to implement a "cheater mode" with a guaranteed win for the upcoming one round of play. The desired behavior is as follows: i. If the player mouse over the Jackpot image, set a boolean variable flag to indicate that this round of play is in cheater Mode. Use this flag to "flip" all of the slot values (and images) to be the same value as currentslot1 after the rollslots() has stopped. ii. i. ii. iii. iv. V. vi. j. [6 marks] Function tallyOnePlay(). No parameters. This function completes one play of the slot machine as follows: Stop the scheduled every 50 ms) function rollslots() from occurring. Set the currentWin value by using calculatePayout(). Add the currentWin value to the currentCredits. Update the play statistics (refer to updatePlayStats(). Invoke updateWinner() as needed. Enable all three buttons ("Place Bet of 1 Credit, Place Bet of 3 Credits, and Play Me Now!") k. [1 mark] Event handler for Play Me Now!" button (with id btnPlay). If the user has enough credits to play, invokes the scheduleOnePlay() function. I. [4 marks] Add to/modify the existing code to implement a "cheater mode" with a guaranteed win for the upcoming one round of play. The desired behavior is as follows: i. If the player mouse over the Jackpot image, set a boolean variable flag to indicate that this round of play is in cheater Mode. Use this flag to "flip" all of the slot values (and images) to be the same value as currentslot1 after the rollslots() has stopped

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!