Ok, i made a psot earlier but my code is alot different and different question so i didnt know where to put it.
My question is thiss... in my calcScore function. This is my requirement:
Design and implement a function double calcScore() that calculates and returns the average of the three scores that remain after dropping the highest and lowest scores a performer received. This function should be called once for each contestant by your function main(), and it should be passed the Stat object that contains the 5 scores from the judges.
I am having trouble of passing the values of score 1-5 into the calcScore function. If i didnt have to use the function it wouldnt be a problem. But I do, and i dont know how to do it.
#include "Stat.h"
#include <iostream>
using namespace std;
void getJudgeData(int &);
double calcScore();
int main()
{
Stat s;
int score1 = 0, score2 = 0, score3=0, score4=0, score5=0;
cout << "This program assignment number 4 was created by Jeremy Rice" << endl;
cout<< "The Next American Idol!!!"<<endl;
cout<< "Please enter your scores below!"<<endl;
cout<< "Enter contestant #1's scores!"<<endl;
cout<<"Judge #1 what is your score"<<endl;
getJudgeData(score1);
s.setNum(score1);
cout<<"Judge #2 what is your score"<<endl;
getJudgeData(score2);
s.setNum(score2);
cout<<"Judge #3 what is your score"<<endl;
getJudgeData(score3);
s.setNum(score3);
cout<<"Judge #4 what is your score"<<endl;
getJudgeData(score4);
s.setNum(score4);
cout<<"Judge #5 what is your score"<<endl;
getJudgeData(score5);
s.setNum(score5);
cout<<"Talent score for contestant #1 is: "<<calcScore()<<endl;
system("pause");
return 0;
}
void getJudgeData(int &getNum)
{
Stat s;
cin>> getNum;
return;
}
double calcScore()
{
Stat s;
cout<<(s.getSum()- s.getMin()- s.getMax()) / 3 <<endl;
}