Pass by reference help
here is the assignment...
Design and implement a function void getJudgeData() that asks the user for a judge's score, stores it in a reference parameter variable, and validates it. This function should be called by your function main() once for each of the 5 judges.
I am having trouble passing it by reference. heres the code
What am i doing wrong to get those wierd numbesr for my min and max ad sum...
i can post the .h and .cpp if needed but i turned that part in already and teacher said it does not need to be modified any further. Any help is really appiciated
#include <iostream>
#include "Stat.h"
using namespace std;
void getJudgeData(int &);
double calcScore();
int main()
{
int score1 = 0, score2 = 0, score3=0, score4=0, score5=0;
Stat s;
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<<"Judge #1 what is your score"<<endl;
getJudgeData(score1);
cout<<"Judge #2 what is your score"<<endl;
getJudgeData(score2);
cout<<"Judge #3 what is your score"<<endl;
getJudgeData(score3);
cout<<"Judge #4 what is your score"<<endl;
getJudgeData(score4);
cout<<"Judge #5 what is your score"<<endl;
getJudgeData(score5);
cout<<s.getMax()<<endl;
cout<<s.getSum()<<endl;
cout<<s.getMin()<<endl;
system("pause");
return 0;
}
void getJudgeData(int &getNum)
{
Stat s;
s.getNum("");
}
// The average is the min and max subtracted
// the remaining three numbers are calculated for average
/*double calcScore()
{
Stat s;
int average = 0;
average(s.getSum - s.getMin - s.getMax)/3;
}
*/

