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:
a.) voidgetScore() 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.
b.) voidcalcAverage() 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.
c.) int findLowest() should find and return the lowest of the five scores passed to it. It should be called by calcAverage, who 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
This is what is got so far...need help on voidcalcAverage...
#include "stdafx.h"
#include <iostream>
using namespace std;
void getScore(int &, int &, int &, int &, int &);
void calcAverage(double, double, double, double, double);
int findLowest();
int main()
{
int s1, s2, s3, s4, s5;
cout << "I am staring in function main.\n";
getScore(s1, s2, s3, s4, s5);
cout << "Now back in main. The 5 test score are: " << endl;
cout << s1 << endl << s2 << endl << s3 << endl << s4 << endl << s5 << endl;
cout << "Now back in main." << endl;
cout << "The average of the 4 highest test scores is: ";
calcAverage(s1, s2, s3, s4, s5);
return 0;
}
void getScore(int &s1, int &s2, int &s3, int &s4, int &s5)
{
cout << "Enter 5 test scores: ";
cin >> s1 >> s2 >> s3 >> s4 >> s5;