You dont have a sample Input or Output? Its really hard to analyze the problem with out the sample. Your prof must have shown you something.
But analyzing the problem gives me a picture thet the input and output would look like this..
Output would look something like
abdcedacbdbdbabdbebdbabdbabdeb12 // First line contains the correct answers.
Followed by the number of students who took the exams.
Which is 12 students.
Then in the next lines it would accept 12 inputs. That is 12 students exam results.
Student Name 25 PASS //Stud name then, Number of correc answers. Then PASS or FAIL
next student here..
Next student here..
You must come up with something first before we could answer some of your questions. They dont encourage us here to do someones Homework here.
You can use declare a string variable. And use a str_pos or substr(what ever it is) method in it. This wouldnt be hard to make.