Question: The program should define three other functions, named printMenu, acceptCommand, and performCommand, to carry out steps a , b , and c , respectively. The
The program should define three other functions, named printMenu, acceptCommand, and performCommand, to carry out steps a b and c respectively. The function to display the menu expects a list of menu options as an argument and displays these options prefixed with numbers. The function to accept an input command expects the length of the menu list as an argument. The function repeatedly prompts the user for a number in the range of options and takes inputs until the user enters a number within the range. The function either displays an error message for an invalid input or returns a valid input. The function to perform a command takes a command number and the menu as arguments and displays the selected command in the menu. Test your program with the menu Open "Save", "Compile", "Run", "Quit" and at least one other menu. Note that all menus must include a "Quit" command as the last item in the menu. LO:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
