Question: write a menu driven program. The program allows a user to enter five numbers and then asks the user to select a choice from a

write a menu driven program.

The program allows a user to enter five numbers and then asks the user to select a choice from a menu. The menu should offer following four options –

Display the smallest number entered

Display the largest number entered

Display the sum of the five numbers entered

Display the average of the five numbers entered

You must use a "switch" statement in your code to determine what action to take. Provide an error message if an invalid choice is entered.

Run the program five times, once with each option and once with an invalid option. Each run is to use the following set of data:

18, 21, 17, 44, 9.

Step by Step Solution

3.44 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

include include int main const int SIZE 5 int numbersSIZE 18 21 17 44 9 int choice do Display menu s... View full answer

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 Programming Questions!