The purpose of this program is to read in string of student answers from a test, and compare those to a string key from an input file. The problem encountered is trying to find the highest score of the student answers using a linear search (see getHigh function)
//prototypes
int getGrade(ifstream&, string, string);
int get_numStud_score(int [])
int getHigh (int []);
int getLow (int []);
void getMean ();
const int questions = 10;
int main()
{
int numScores = 11;
int test_scores[questions];
string student_answers;
string key;
int numrightAns;
ifstream inFile;
inFile.open ("grade_data.txt");
if (!inFile)
{
cout << "Error: File failed to open" << endl;
}
You haven't initialized the test_scores array. Additionally, why did you initialize the i in the for loop in the getHigh() function to 1? Lastly, in the following: