/* * Note to CS70 students: this is an incomplete source file. You must * complete it as you feel appropriate. Search for "ADD STUFF" to * find places you *MAY* need to change. * * Note that many comments are missing. We have not provided "ADD * STUFF" hints for missing comments. */ #include "course.hh" #include "student.hh" #include #include #include /* * Table of Contents: the following routines are defined in this file: * * Student::Student(); * Student::Student(const string& firstName_, * const string& lastName_, const string& hairColor_); * Student::~Student(); * void Student::fillInInfo(const string& firstName_, * const string& lastName_, const string& hairColor_); * // Fill in student info * string Student::name() const; * // Return student's full name * bool Student::overloaded() const; * // True if can't add any more courses * void Student::changeHairColor(const string& newColor); * // Dye student's hair * bool Student::addCourseToSchedule(Course* course); * // Insert course in schedule * bool Student::removeCourseFromSchedule(Course* course); * // Remove course from schedule * ostream& Student::print(ostream& targetStream) const; * // Produce representation of student * void Student::dropAllCourses(); * // Remove student from all enrollment */ Student::Student() : fullName(), hairColor(), courseCount(0) { // ADD STUFF } Student::~Student() { // ADD STUFF } /* * Pseudo-constructor to fill in student information after the fact. * This should really be done using a copy constructor and assignment * operator, but I'm not 100% sure we'll have covered them in time. */ void Student::fillInInfo( const string& firstName_, const string& lastName_, const string& hairColor_) { // ADD STUFF } /* * Return the student's full name in "last, first" format. Depending * on how this function is implemented, it might be possible to return * a "const string&", which would make it more efficient. However, * the "string" return type declaration is necessary if the full name * is constructed "on the fly", and causes no harm in other * situations, so I have chosen that form. */ string Student::name() // Return student's full name const { // ADD STUFF } bool Student::isOverloaded() // True if can't add any more courses const { // ADD STUFF } void Student::changeHairColor( // Dye student's hair const string& newColor) // New color to give to hair { // ADD STUFF } bool Student::addCourseToSchedule( // Insert course in schedule Course* course) // Course being added { // ADD STUFF } bool Student::removeCourseFromSchedule( // Remove course from schedule Course* course) // Course being removed { // ADD STUFF } ostream& Student::print( // Produce representation of student ostream& targetStream) // Stream to print to const { // ADD STUFF // THIS ROUTINE SHOULD PRODUCE THE FULL STUDENT OUTPUT: NAME, HAIR // COLOR, AND COURSE LIST return targetStream; } void Student::dropAllCourses() // Remove student from all enrollment { // ADD STUFF }