Trying to write a program for my C++ class.
Basically; call a function getJudgeData five times within the main function to get five different scores. Send the scores from getJudgeData function to calcScore function. From there use two more functions, findHighest and findLowest to find the highest and lowest score, then send them back to calcScore. Subtract those two scores from the rest and average what's left.
ANYWAY. I pretty much have this program down, I just can't seem to find whatever stupid mistake I made that gives me the following errors:
Error 1 error C2660: 'getJudgeData' : function does not take 1 arguments c:\users\jessikwa\documents\visual studio 2010\projects\star search\star search\main.cpp 9 1 Star Search
Error 2 error C2660: 'getJudgeData' : function does not take 1 arguments c:\users\jessikwa\documents\visual studio 2010\projects\star search\star search\main.cpp 10 1 Star Search
Error 3 error C2660: 'getJudgeData' : function does not take 1 arguments c:\users\jessikwa\documents\visual studio 2010\projects\star search\star search\main.cpp 11 1 Star Search
Error 4 error C2660: 'getJudgeData' : function does not take 1 arguments c:\users\jessikwa\documents\visual studio 2010\projects\star search\star search\main.cpp 12 1 Star Search
Error 5 error C2660: 'getJudgeData' : function does not take 1 arguments c:\users\jessikwa\documents\visual studio 2010\projects\star search\star search\main.cpp 13 1 Star Search
Error 6 error C2660: 'calcScore' : function does not take 5 arguments c:\users\jessikwa\documents\visual studio 2010\projects\star search\star search\main.cpp 41 1 Star Search
Error 7 error C2660: 'findHighest' : function does not take 5 arguments c:\users\jessikwa\documents\visual studio 2010\projects\star search\star search\main.cpp 48 1 Star Search
Error 8 error C2660: 'findLowest' : function does not take 5 arguments c:\users\jessikwa\documents\visual studio 2010\projects\star search\star search\main.cpp 49 1 Star Search
Here is my code:
#include <iostream>
using namespace std;
void getJudgeData();
void calcScore();
double findHighest();
double findLowest();
int main()
{
getJudgeData(1);
getJudgeData(2);
getJudgeData(3);
getJudgeData(4);
getJudgeData(5);
system("pause");
return 0;
}
void getJudgeData(int count)
{
double score1, score2, score3, score4, score5;
switch(count)
{
case 1: cout << "Please enter the score for judge " << count;
cin >> score1;
break;
case 2: cout << "Please enter the score for judge " << count;
cin >> score2;
case 3: cout << "Please enter the score for judge " << count;
cin >> score3;
break;
case 4: cout << "Please enter the score for judge " << count;
cin >> score4;
break;
case 5: cout << "Please enter the score for judge " << count;
cin >> score5;
break;
}
calcScore(score1, score2, score3, score4, score5);
}
void calcScore(double one, double two, double three, double four, double five)
{
double hs, ls, avg;
hs = findHighest(one, two, three, four, five);
ls = findLowest(one, two, three, four, five);
avg = ((one + two + three + four + five) - (hs+ls))/3;
cout << "The contestant's final score was " << avg;
}
double findHighest(double h1, double h2, double h3, double h4, double h5)
{
double hs = 10;
if (h1 > hs)
{
h1 = hs;
}
else if (h2 > hs)
{
h2 = hs;
}
else if (h3 > hs)
{
h3 = hs;
}
else if (h4 > hs)
{
h4 = hs;
}
else if (h5 > hs)
{
h5 = hs;
}
return hs;
}
double findLowest (double l1, double l2, double l3, double l4, double l5)
{
double ls = 1;
if (l1 < ls)
{
l1 = ls;
}
else if (l2 < ls)
{
l2 = ls;
}
else if (l3 < ls)
{
l3 = ls;
}
else if (l4 < ls)
{
l4 = ls;
}
else if (l5 < ls)
{
l5 = ls;
}
return ls;
}
Any help is MUCH appreciated.