1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
#include <iostream>
using namespace std;
void getScore(double);
void calcAverage(double,double,double,double,double);
int findlowest(double, double, double, double, double);
int main()
{
const int NumOfTests = 5;
double testScore, testScore2,testScore3,testScore4,testScore5 = 0;
cout<<"Input 5 Test Scores And This Program Will Calculate The"<<endl;
cout<<"Average and drop the lowest test score."<<endl;
cin>>testScore;
getScore(testScore);
cin>>testScore2;
getScore(testScore2);
cin>>testScore3;
getScore(testScore3);
cin>>testScore4;
getScore(testScore4);
cin>>testScore5;
getScore(testScore5);
calcAverage(testScore,testScore2,testScore3,testScore4,testScore5);
}
void getScore(double testScore)
{
double var = testScore;
while (var < 0 | var > 100)
{
cout<<"Invalid Test Score. Pease Input A Valid Test Score."<<endl;
cin>>var;
}
}
void calcAverage(double testScore, double testScore2, double testScore3, double testScore4, double testScore5)
{
double num = testScore;
double num2 = testScore2;
double num3 = testScore3;
double num4 = testScore4;
double num5 = testScore5;
double sum = num+num2+num3+num4+num5;
int findLowest(num,/*<-- HERE!!!*/ num2, num3, num4, num5); //HERE!!!!!
double average = sum/4;
}
int findLowest()
{
}
|