Hey guys. I have a programming class that I take once a week at my college. I had to miss last weeks class because of work, so I missed a ton of information. After reading through his notes online, I'm still lost. This is the last problem and I've been hung up on it for roughly an hour. This isn't the template code he gives you, this is what I've done after an hour. These are the instructions:
Modify the program above like this. We do not want to get scores, calculate and display their average in the main function. Instead, add a function getScoresFindAverage to perform these tasks. This function should return the average to main, so later it can be passed to toletterGrade to determine the letter grade.
This is the error I'm getting:
[Error] expected unqualified-id before '{' token
I'm assuming it's because I didn't do something with the getScoresFindAverage function in the beginning, but I'm really lost. Can anyone help?
In function 'double getScoresFindAverage(double)':
[Error] 'average' was not declared in this scope
[Error] 'midterm' was not declared in this scope
[Error] 'final' was not declared in this scope
[Error] 'project' was not declared in this scope
You need to declare used variables. You probably want to pass midterm, final and project to function and declare local variable average, you will return later.
Do either of you guys mind looking over what I have here as well? I have run into the same problems discussed, and tried reviewing your suggestions, but can not get my program to run either.
can you give an example, im not sure where i should call the function that prints out the course grade other than how i did with "void toLetterGrade (double average)"