Khan.randRange(6, 8) Khan.randRange(0, max_size - 1) Khan.randRange(0, 999) astackPopPRO.initJSAV(max_size, arr_size, insert_value)

Your task in this exercise is to show the behavior for the array-based stack's pop operation. In the array displayed below, the "top" position is arr_size .

You can copy a value from the stack to the "return" box by first clicking on the value in the stack, then clicking on the "return" box.

To change the value of "top", click on a cell in the array to highlight it, then click "Set Top".

[astackPopPRO.userInput]
if (!astackPopPRO.checkAnswer(max_size, arr_size) && !guess[0]) { return ""; // User did not click, and correct answer is not // initial array state } else { return astackPopPRO.checkAnswer(max_size, arr_size); }

If the index of "top" is 0, then the stack is empty and nothing can be pop'ed. In this case, just click "check answer".

Otherwise, the first step would be to copy the top value into the "return" box.

Finally, decrease the "top" index by 1.