Menu

[solved]-Use Arrays Know Arrays Want Use 3 Variables Force Use Compound Logical Statements Statemen Q39023750

DO NOT USE ARRAYS IF YOU KNOW ABOUT ARRAYS, IWANT YOU TO USE 3 VARIABLES, IT WILL FORCE YOU TO USE COMPOUNDLOGICAL STATEMENTS FOR THE IF STATEMENTS.

Create a program that will display a menu to the user. Thechoices should be as follows:

  1. Enter 3 grades
  2. Show average (with the 3 grades) and letter grade
  3. Show highest grade
  4. Show lowest grade
  5. Exit

If you want to put the menu into a function you may. The programshould use a switch statement for using the appropriate functionbased on the user’s choice. Each option should be implemented inits own function (I use the word function 1, function 2, I want youto come up with appropriate names for the functions). Initializethe variables for grades randomly between 50-100 so if the userselect show average as their first choice, there will be somerandom grades in the variables already.

You should have the following functions:

Function 1: This function will ask the user fora single grade that will be passed back to the main function. Thefunction should validate that the grade is in the range between0-100 otherwise ask the user to enter another grade. This functionshould be called 3 times from the main to place the appropriatevalues into the grade variables.

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

AverageLetter Grade90 – 100A80 – 90B70 – 79C60 – 69DBelow 60F

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

Function 4: This function will receive 3 gradesas parameters and returns the lowest grade to the main. The mainwill use that value to display the lowest grade. Do not display thehighest grade in this function.

Use a loop to repeat the entire program until the users hits 5to exit.

Expert Answer


Answer to DO NOT USE ARRAYS IF YOU KNOW ABOUT ARRAYS, I WANT YOU TO USE 3 VARIABLES, IT WILL FORCE YOU TO USE COMPOUND LOGICAL STA… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *