# Calculating Avg Score

I am creating a program that will ask the user to enter 5 scores, then it will take these 5 scores and drop the highest and lowest scores. It will then average the 3 remaining scores. I am doing this without the use of arrays.

I have 6 errors. What I am not understanding is what the correct parameters are for each function, can anyone help me on this?

[code]

# include
# include
using namespace std;

void getJudgeData (double&score) {

cout<<"Enter the judge's score:";
cin>> score;

while (score < 0 || score > 10) {
cout<< "Invalid Score."<<endl;
cout<< "Enter judge's score:";
cin >> score;
}
}
int findHighest (double x){
double highest = 0;
double a,b,c,d,e;
if (a > highest)
highest = a;
if (b > highest)
highest = b;
if (c > highest)
highest = c;
if (d > highest)
highest = d;
if (e > highest)
highest = e;

return highest;
}

int findLowest (double y) {
double lowest = 10;
double a,b,c,d,e;
if (a < lowest)
lowest = a;
if (b < lowest)
lowest = b;
if (c < lowest)
lowest = c;
if (d < lowest)
lowest = d;
if (e < lowest)
lowest = e;

return lowest;
}
void calcScore (double a, double b, double c, double d, double e) {
double sum;
double avg;
double highest,lowest;

sum = a+b+c+d+e;
sum = sum - findHighest(double highest)-findLowest(double lowest);
avg = sum/3;
}

int main () {

double score1,score2,score3,score4,score5;
double avg;

getJudgeData(score1);
getJudgeData(score2);
getJudgeData(score3);
getJudgeData(score4);
getJudgeData(score5);
calcScore(double a,b,c,d,e);

return 0;
}

[/code]
Sign In or Register to comment.

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!