Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Lab 09: Hint pop() 2

To throw an exception when the stack is empty, the pop() method should behave as follows:

If I am empty {
    throw a StackException whose method is "pop()" and whose message is "stack is empty".
} 
a. Subtract 1 from mySize.
b. Return the entry of myArray whose index is mySize.