I have two char arrays. One is the correct answers to the exam, char[] answers and the other is the char[] studentAnswers. I want to compare the two arrays and if there is an incorrect answer I want to store what questions they got wrong.
questionsMissed = i
questionsMissed = studentAnswers[i]
public int[] questionsMissed(char[] studentAnswers)
{
for(int i = 0; i<studentAnswers.length; i++){
if(studentAnswers[i] != answers[i]){
questionsMissed =;
}
}
return questionsMissed;
}
I want questionMissed to store the index of the char values that do not match.
iif they got the question wrong or a 0 if they got it correct.