Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please do not use arrays for this program. Create a program that will display a menu to the user. The choices should be as follows:

Please do not use arrays for this program.

Create a program that will display a menu to the user. The choices should be as follows: Enter 3 grades Show average (with the 3 grades) and letter grade Show highest grade Show lowest grade Exit If you want to put the menu into a function you may. The program should use a switch statement for using the appropriate function based on the user's choice. Each option should be implemented in its own function (I use the word function 1, function 2, I want you to come up with appropriate names for the functions). Initialize the variables for grades randomly between 50-100 so if the user selects show average as their first choice, there will be some random grades in the variables already. You should have the following functions:

Function 1: This function will ask the user for a single grade that will be passed back to the main function. The function should validate that the grade is in the range between 0-100 otherwise ask the user to enter another grade. This function should be called 3 times from the main to place the appropriate values into the grade variables.

Function 2: This function will calculate the average of the 3 grades passed in and display the average with 1 decimal place and display the letter grade based on the following scale:

Average Letter Grade

90 - 100 A

80 - 90 B

70 - 79 C

60 - 69 D

Below 60 F

Function 3: This function will receive 3 grades as parameters and returns the highest grade to the main. The main will use that value to display the highest grade. Do not display the highest grade in this function.

Function 4: This function will receive 3 grades as parameters and returns the lowest grade to the main. The main will use that value to display the lowest grade. Do not display the lowest grade in this function. Use a loop to repeat the entire program until the users hits 5 to exit.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

Explain the nature of paid work

Answered: 1 week ago

Question

3. What changes should I be making?

Answered: 1 week ago

Question

2. Why?

Answered: 1 week ago