int main()
{
    // students who did and didn't do all of their homework
    vector<Student_info> did, didnt;

    // read the students records and partition them
    Student_info student;
    while (student.read(cin)) {
        if (student.did_all_hw())
            did.push_back(student);
        else
            didnt.push_back(student);
    }

    // verify that the analysis will show us something
    if (did.empty()) {
        cout << "No student did all the homework!" << endl;
        return 1;
    }
    if (didnt.empty()) {
        cout << "Every student did all the homework!" << endl;
        return 1;
    }

    // do the analyses
    write_analysis(cout, "median", median_analysis, did, didnt);
    write_analysis(cout, "average", average_analysis, did, didnt);
    write_analysis(cout, "median of homework turned in", optimistic_median_analysis, did, didnt);

    return 0;
}