Now you need to read in the file. You could probably do something along these lines:
- read in a line (I recomment using getline()
- parse that line to get the student's name.
- continue parsing to get a list of scores. Add these together, probably as you read them in.
- compare this to the total score (where are you getting that anyways?) and determine if the student passes.
- do this till you have all of the data read
Then comes the tricky part. You need to sort all the data by students' last name. It would be easiest if you kept the data in an object, but that's not necessary (just a little more hassle without). You need to sort the data by last name, and make sure you keep all associated data together as you do it. This'll be kinda tricky if you just use indepented arrays/vectors of names, scores, etc...
Then output the students info in the new sorted order. As you do this, you could keep track of the number of students, and start averaging their scores. You could also do this in separately, but why put it off till later? Anyways, after you've gone through the list of students you'll have the other statistics you need, so you can output those too.
Good luck ;)
[edit:] oh, and you seem to have missed the part about code tags. Please use them, since it preserves your code formatting …