ames1951 wrote: |
---|
I am still encountering an error though?? |
That is a not a very helpful statement. Would you like to be more specific?
Amongst other things:
(1) You haven't defined any of readData(), assignGrade(), findHighestScore(), print(), so you can't call them from your program. Comment them out until you have written them.
(2) As it stands these statements look like a mishmash of function declarations and function calls, with arguments that are a mix of variable names and variable types. Consider
readData(inFile, studentType);
inFile is a local variable. studentType is a variable type. Notice a problem? Also, assuming you want the entire students[] array, your prototype will have to reflect the desire to pass an array, not a scalar. Until you write that function your linker will be unhappy.
(3) On line 48 outFIle isn't the name of anything (watch out for upper case/lower case).
(4) Your bracketing is wrong - and not helped by your indenting - on testing the validity of your input/output streams. For example, lines 31 to 36 are equivalent to:
1 2 3 4 5 6
|
inFile.open("Ch9_Ex2Data.txt");
if(!inFile)
{
cout << "Cannot open file"<< endl;
}
return 1; // so it will return without doing anything anyway.
|
Similarly with the output stream.
(5) Your indenting (or lack, or inconsistency, of it) is extremely confusing.