I have been working on this for about a week and I am stuck. Its an american idol program, where 5 judges score contestants. I have the classes all figured out, my teacher said to not modify it any further to just work on my main.cpp
I am to make a function 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.
There are other issues with the main.cpp but i am mostly working on the function right now. I need help to pass it by reference. This is what I have. How would I pass the scores by reference? If needed I can also post the stat.h and stat.cpp files. Any help is REALLY appiciated cause I could use all the help i could get.
CODE
#include <iostream>
#include "Stat.h"
using namespace std;
void getJudgeData();
double calcScore();
int main()
{
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;
// asking for the scores from each judge
//using the function getJudgeData
getJudgeData();
system("pause");
return 0;
}
void getJudgeData()
{
Stat s;
s.getNum("Please enter your score Judge #1 ");
s.getNum("Please enter your score Judge #2 ");
s.getNum("Please enter your score Judge #3 ");
s.getNum("Please enter your score Judge #4 ");
s.getNum("Please enter your score Judge #5 ");
}
// 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;
}