Question: Lowest Score Drop Write a program that calculates the average of a group of test scores, where the lowest score in the group is dropped.

Lowest Score Drop 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.

#include

using namespace std;

// Function prototypes

void getScore(int &);

void calcAverage(int, int, int, int, int);

int findLowest(int, int, int, int, int);

int main()

{

int score1; // To hold the 1st test score

int score2; // To hold the 2nd test score

int score3; // To hold the 3rd test score

int score4; // To hold the 4th test score

int score5; // To hold the 5th test score

// Call the getScore function to get the five test scores.

// Call calculateAverage to calculate and display the test score average,

// after dropping the lowest score.

return 0;

}

// ********************************************************

// The getScore function asks the user for a test score, *

// stores it in a reference parameter variable, and *

// validates it. *

// ********************************************************

void getScore(int &score)

{

}

// ********************************************************

// The calcAverage function calculates and displays the *

// average of the four highest scores. *

// ********************************************************

void calcAverage(int score1, int score2, int score3,

int score4, int score5)

{

int average;

// Get the lowest score.

// Get the total of all the scores.

// Drop the lowest score and calculate the average.

// Display the average.

cout << "After dropping the lowest score, "

<< "the test average is "

<< average << ". ";

}

// ********************************************************

// The findLowest function finds and returns the lowest *

// of the five scores passed to it. *

// ********************************************************

int findLowest(int score1, int score2, int score3,

int score4, int score5)

{

int lowest; // To hold the lowest score.

// Determine the lowest of the five scores.

// Return the lowest score.

return lowest;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!