I'm having an issue writing this program. I am supposed to write a program to calculate 3 test scores and find an average using functions. I have to call the two functions getTestScore and calcAverage. Im just not understanding this I guess. Im quite new so mind my ignorance. This is my code, any help would be great. Thanks again.
Your call in main to calcAverage is missing parameters.
Also you don't need to pass in average to calcAverage, it returns it.
Change double calcAverage(int average, int testScores);
to double calcAverage(int testScores);
remove the following 3 lines from getTestScores. The first return hit is the end of the fuction.
1 2 3
return test1;
return test2;
return test3;
Also change the following line in calcAverage function. Casting testScoures from int to double, this forces the divide to be real not integer. averageScore = testScores / 3;
to averageScore = (double)testScores / 3;