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().](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3a09ca8361_39666f3a09c47be3.jpg)
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
Get step-by-step solutions from verified subject matter experts
