Algorithm for the function e:
The algorithm for the function eoption is as shown:
- Use the menu function to show the 4 choices.
- Error-check (an error would take place if the user clicks the X on the menu box instead of pressing one of the 4 buttons) by looping to show the menu until the user clicks one of the buttons.
- Return the integer value equivalent to the button press.