Writing code to determine how correct a student was on a True/False test...
I can't for the life of me figure out how to compare the two char arrays and come up with the right answer for returning the amount of correct answers the student gave. Can someone give me some help?
The problem is not your checking of the correct answers, but where you're doing it.
You call inputStudentData once. For each student, you're storing into studentAnswer overwriting the previous student's answers. When you call processData at line 21, you have only the results of the last student in studentAnswer.
BTW, it's not a good idea to use the same index variable in two nested for loops (lines 57-58). What you have is not illegal, but if you wanted to reference the outter loop variable inside the inner loop, you would not be able to do so.
Other problems:
Line 27: The backslash characters are escape characters. \( and \) are not valid escape sequences. If you want to use \ as a printable character in a literal, you must double them.
Shoot, I have another problem. When I enter the student's answers, everything works fine. However I have another problem. When calculating the percentage, only getting 100% seems to want to work.
At the end when it displays the percentage, getting any number of questions wrong other than 10 will result in 0%. What's going on? I tried putting percentage as an int and as a double but neither works.
Line 32: answersCorrect and SIZE_OF_TEST are both integers, so you're doing integer division. 9/10=0. Cast answersCorrect to a double before doing the divison.