Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

include include int main const int SIZE 5 int numbersSIZE 18 21 17 44 9 int choice do Display menu s... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Starting Out With Java From Control Structures Through Data Structures

Authors: Tony Gaddis

6th Edition

0133957055, 978-0133957051

More Books

Students also viewed these Programming questions

Question

Describe work in process inventory.

Answered: 1 week ago

Question

What is the purpose of testing a program with sample data or input?

Answered: 1 week ago