I have a project due for a class I am taking and am just not getting it! Unfortunately, no one has been available in the labs at the college to help me out, so I am hoping someone here can. The exercise is:
A particular talen cometition has 5 judges, each of whom awards a score between 0 and 10 to each performer. Fractional scores, such as 8.3 are allowed. A performers final score is determined by dropping the highest and lowest scores received, then averaging the 3 remaining scores. Write a program that uses this method to calculate a contestant's score. It should include the following functions:
* void getJudgeData() should ask the user for a judge's score, store it in a reference perameter variable, and validate it. This function should be called by main once for each of the 5 judges.
* void calcScore() should calculate and display the average of the 3 scores that reamin after dropping the highest and lowest scores. This function should be called just once by main, and should be passed the 5 scores.
The last two functions should be called by calcScore, who uses the returned information to determine which of the scores to drop.
* int findLowest() should find and return the lowest of the 5 scores passed to it
* int fineHighest() should find and return the lowest of the 5 scores passed to it.
Input validation, don't accept judges scores lower than 0 or higher than 10.
Here is what I have so far.......
// This program gives the average judge's score while dropping
// the lowest and highest score
#include <iostream>
using namespace std;
double score;
int judge;
int main()
{
void getJudgeData(int judge)
{
cout <<"Please enter Judge " << judge <<"'s score:\n";
cin >> score;
while (score < 0 || score > 10)
{
cout << "Score must be between 0 and 10. Please enter a score in that range:\n";
cin >> score;
}
}
{
getJudgeData(1);
getJudgeData(2);
getJudgeData(3);
getJudgeData(4);
getJudgeData(5);
}
{
int findLowest(double &refVar);
}
{
int findHighest(double &refVar);
}
{
void calcScore();
}
cout << "more here";
return 0;
}
A particular talen cometition has 5 judges, each of whom awards a score between 0 and 10 to each performer. Fractional scores, such as 8.3 are allowed. A performers final score is determined by dropping the highest and lowest scores received, then averaging the 3 remaining scores. Write a program that uses this method to calculate a contestant's score. It should include the following functions:
* void getJudgeData() should ask the user for a judge's score, store it in a reference perameter variable, and validate it. This function should be called by main once for each of the 5 judges.
* void calcScore() should calculate and display the average of the 3 scores that reamin after dropping the highest and lowest scores. This function should be called just once by main, and should be passed the 5 scores.
The last two functions should be called by calcScore, who uses the returned information to determine which of the scores to drop.
* int findLowest() should find and return the lowest of the 5 scores passed to it
* int fineHighest() should find and return the lowest of the 5 scores passed to it.
Input validation, don't accept judges scores lower than 0 or higher than 10.
Here is what I have so far.......
// This program gives the average judge's score while dropping
// the lowest and highest score
#include <iostream>
using namespace std;
double score;
int judge;
int main()
{
void getJudgeData(int judge)
{
cout <<"Please enter Judge " << judge <<"'s score:\n";
cin >> score;
while (score < 0 || score > 10)
{
cout << "Score must be between 0 and 10. Please enter a score in that range:\n";
cin >> score;
}
}
{
getJudgeData(1);
getJudgeData(2);
getJudgeData(3);
getJudgeData(4);
getJudgeData(5);
}
{
int findLowest(double &refVar);
}
{
int findHighest(double &refVar);
}
{
void calcScore();
}
cout << "more here";
return 0;
}