I am trying to create a program that will take an answer key to a test from a file, put it into a character array, and then take two more two dimensional arrays from files which contains the students IDs and their test answers. It then compares their answers to the key using another function. I have the first two functions done, but I can't get the element comparison to work. Here's what I have for the compare function:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
void computeResults (char test[][10], char key[])
{
int correct[30];
int end, i = 0;
while (i < 30)
{
int j = 0;
while (j < 10)
{
if (test[i][j] == key[i])
correct[i] +=1;
}
cout<< correct[i];
cin>> end;
}
}
It also needs to display the ID Answers, and Number correct in the main function. I am grateful for any help regarding this.