The problem is that you are calling the letterGrade() function before it is defined.
Basically, the compiler is going through your code line by line and analyzing it all. Whenever it gets to the call for letterGrade() it checks it's "search history" and says "Hold the phone! I don't remember seeing this function anywhere! Error!"
You need to add what is called a function prototype to tell the compiler that the definition is coming later.
At the top of your code below all of the 'using' statements add this prototype.
Ah yeah derp. What's odd is all I did was add the struct, otherwise this is the teachers template, odd to think he would give it to us needing to correct it :P.
You should probably place the letterGrade prototype just above computeAverage function definition OR move the definition as a whole above the computeAverage.
What the french toast is going on?
The compiler as at the definition of computeAverage couldn't find letterGrade function because it hasn't been "declared or defined".
since you are not using prototype ( declare function before uses it )
defining functions without declaring it , it should be always at the top who will use it
i mean...
example:
1 2 3
void func1() {
// calls func2();
}
in this snippet above, it says in the body that func1 calls func2 therefore, func2 should be define above the func1.
so the code should be like this
if you define it under the func1 , it will surely give you an error that the func2 hasnt declared yet. ( it means you havent yet declared it or defined it above who will use it )
Consider changing computeAverage() and outputRecord() to be methods of struct Record. If you don't, then do change outputRecord() to take a reference to Record. The current code makes a copy of the record each time you call outputRecord()