I needed some C++ practice (I've been stuck in strictly-C world for far too long) so I did this program as a quick exercise. There are a number of ways to get the data in, but this is one way.
bool Seminar::loadData(const string &filename)
cerr << "Unable to open " << filename << endl;
// First, get the student's name into a string.
s >> name;
if (name == "")
continue; //blank line...skip it
// OK, create the student.
// Read the grades until you find the sentinel values.
s >> classname >> grade;
if (classname == STOP_SIGNAL && grade == STOP_GRADE)
break; // Found the sentinels, so get out.
// Create a grade
Grade g(classname, grade);
// Add the grade to the student's record
// Add the student to the seminar's class list.
// Close the open file.