Question: In C Language Please Build and present a menu to a user like the following and enclose it into a loop that ends when the
In C Language Please
- Build and present a menu to a user like the following and enclose it into a loop that ends when the Quit option is chosen. Scan the user's selection into an integer variable.
1. Enter user name. 2. Enter test scores. 3. Display average. 4. Display summary. 5. Quit. Selection:
- If the user selects Option #1, scan the user's name, and store it to a char array. Assume the user's name is under 20 characters.
- If the user selects Option #2, use a for-loop to scan 5 test scores into a float array. Calculate the average and store the result in a float variable. You can assume all scores are valid and out of 100 points.
- If the user selects Option #3, Display the average of the test scores. If the user has not yet entered test scores, display an error message similar to: "Please use the menu to enter test scores first" Hint: Declare variables of type bool to keep track of the options that have been selected.
- If the user selects Option #4, display the average, the letter grade of the average, and the user's name. If the user has not yet entered their name or test scores, display an error message. Example: "Hello Charley, your test scores were 80, 75, 82, 91, and 100. Your average is 85.6 with letter grade: B." Example: "Please use the menu to enter your name first." Example: "Please use the menu to enter your test scores first."
- When the Quit option is chosen, end the primary loop that contains the menu.
- Describe a scenario in which a programmer might find it most appropriate to implement a for loop.
- Describe a scenario in which a programmer might find it most appropriate to implement a while loop.
- Describe a scenario in which a programmer might find it most appropriate to implement a do while loop.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
