Try the fastest way to create flashcards

Related questions with answers

Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Write the following functions in the program:

•calc_average —This function should accept five test scores as arguments and return the average of the scores.•determine_grade —This function should accept a test score as an argument and return a letter grade for the score based on the following grading scale:\begin{matrix} • \text{calc}\_\text{average}\text{ —This function should accept five test scores as arguments and}\\\text{ return the average of the scores.}\\ • \text{determine}\_\text{grade —This function should accept a test score as an argument}\\\text{ and return a letter grade for the score based on the following grading scale:}\\ \end{matrix}

ScoreLetter Grade90–100A80–89B70–79C60–69DBelow 60F\begin{matrix} \text{Score} & \text{Letter Grade}\\ \hline \text{90–100} & \text{A}\\ \text{80–89} & \text{B}\\ \text{70–79} & \text{C}\\ \text{60–69} & \text{D}\\ \text{Below 60} & \text{F}\\ \end{matrix}

Question

Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped. It should use the following functions: - void getScore () should ask the user for a test score, store it in a reference parameter variable, and validate it. This function should be called by main once for each of the five scores to be entered. - void calcAverage () should calculate and display the average of the four highest scores. This function should be called just once by main and should be passed the five scores. - int findLowest () should find and return the lowest of the five scores passed to it. It should be called by calcAverage, which uses the function to determine which of the five scores to drop. Input Validation: Do not accept test scores lower than 0 or higher than 100.

Solution

Verified
Answered 1 year ago
Answered 1 year ago
Step 1
1 of 3

According to the exercise, the program must calculate the average of a group of test scores, where the lowest score in the group is dropped.

Create a free account to view solutions

Create a free account to view solutions

Recommended textbook solutions

Starting Out with C++ from Control Structures to Objects 8th Edition by Godfrey Muganda, Judy Walters, Tony Gaddis

Starting Out with C++ from Control Structures to Objects

8th EditionISBN: 9780133769395 (7 more)Godfrey Muganda, Judy Walters, Tony Gaddis
1,374 solutions
Fundamentals of Database Systems 7th Edition by Ramez Elmasri, Shamkant B. Navathe

Fundamentals of Database Systems

7th EditionISBN: 9780133970777Ramez Elmasri, Shamkant B. Navathe
961 solutions
Introduction to Algorithms 3rd Edition by Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen

Introduction to Algorithms

3rd EditionISBN: 9780262033848Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen
872 solutions
Introduction to Algorithms 4th Edition by Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen

Introduction to Algorithms

4th EditionISBN: 9780262046305Charles E. Leiserson, Clifford Stein, Ronald L. Rivest, Thomas H. Cormen
945 solutions

More related questions

1/4

1/7