Question: 1. (Design/Problem Solving) A menu program is one that has a number of different options which are presented to the user for them to pick

1. (Design/Problem Solving)

A menu program is one that has a number of different options which are presented to the user for them to pick one. Once the user has entered their selection, the program carries out the task related to the user's choice and then re-displays the menu, so the process begins again.

Create an algorithm for a menu based program that uses a switch-case statement to include the following options:

a) Print your name.

b) Print your tutorial time.

c)Prompt the user to enter a positive number between 1-50, read the entered input, and display all numbers from 0 up to the number entered (the display should print five numbers per line).

E.g., if the user enters 5, the program will display 0 1 2 3 4 5.

q) Quit

The user should be able to continuously enter and execute options until they enter the 'a character to quit. The algorithm should be able to accept the upper- and lower-case versions of all character input options and should be able to deal with invalid options being input for all input (including the number required for part c).

Note: for the first two options, the program does not need to read in your name/tutorial time and then print this out. It simply needs to output a message that you hard code into the program.

Your solution must be modular in design. Start with a high-level algorithm and then break this down into the individual steps (i.e., low-level algorithm for each function in the high-level algorithm).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!