HELP ! Expecting ')'

Hey guys, first time poster. I'm currently working on a class assignment and i ws going pretty well except i ran into this syntax error.. "expecting a ')' " Which is located on the first comma after the "num" variable any help would e greatly appreciated. It's located on "calcAverage" function. i'm not exactly sure why this error popped up and i've tried some different experiments to see if itd go away but so far i'm stumped.. Thanks!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#include <iostream>
using namespace std;
void getScore(double);
void calcAverage(double,double,double,double,double);
int findlowest(double, double, double, double, double);

int main()
{
	const int NumOfTests = 5;
	double testScore, testScore2,testScore3,testScore4,testScore5 = 0;
	
cout<<"Input 5 Test Scores And This Program Will Calculate The"<<endl;
cout<<"Average and drop the lowest test score."<<endl;
cin>>testScore;
getScore(testScore);
cin>>testScore2;
getScore(testScore2);
cin>>testScore3;
getScore(testScore3);
cin>>testScore4;
getScore(testScore4);
cin>>testScore5;
getScore(testScore5);
calcAverage(testScore,testScore2,testScore3,testScore4,testScore5);

}
  
void getScore(double testScore)
{ 
double var = testScore;
	while (var < 0		|	 var > 100)
	{
	cout<<"Invalid Test Score. Pease Input A Valid Test Score."<<endl;
	cin>>var;
	}
	
}

void calcAverage(double testScore, double testScore2, double testScore3, double testScore4, double testScore5)
{
	double num = testScore;
	double num2 = testScore2;
	double num3 = testScore3;
	double num4 = testScore4;
	double num5 = testScore5;
	double sum = num+num2+num3+num4+num5; 
	int findLowest(num,/*<-- HERE!!!*/  num2, num3, num4, num5); //HERE!!!!!
	double average = sum/4;

	
}

int findLowest()
{


}
Last edited on
On line 47, what you meant to do was call the function findLowest(), but you've done so incorrectly, because of the type specifier int.

However, several things I noticed:

1.) If findLowest() returns an integer, you need to assign the return value of that function to something, in order to use it.

1.5) I'm assuming that findLowest() will return the lowest of the parameters, however, they're doubles, and the result will be truncated.

2.) The declaration and definition of findLowest() don't match. Also, findLowest() doesn't do anything.
Topic archived. No new replies allowed.