The output of this program is supposed to be "name" "grade". However when I run it I only get "grade". The name will never show up. I've tried using while (!cin.eof()) but I keep getting an infinite loop with that.
The input is a bunch of words. It could start with numbers, which should be added to "grade", or it could start with words. Words that aren't NAME, the person's name (only after NAME), and AVERAGE are to be ignored.