c/c++课的作业合集,都是很简单的文件。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
1.0 KiB

#include <sstream>
#include "Graduate.h"
Graduate::Graduate(const std::string &id, const std::string &name, char sex, const std::string &identNumber,
const Date &birthday, int classId, const std::string &subject, const Teacher &adviser,
const Person &person) :
Student(id, name, sex, identNumber, birthday, classId), subject(subject), adviser(adviser), Person(person) {}
Graduate::Graduate(int classId, const Person &person, const std::string &subject, const Teacher &adviser) : Student(
classId, person), subject(subject), adviser(adviser), Person(person) {}
Graduate::Graduate(const Graduate &graduate) : subject(graduate.subject), adviser(graduate.adviser),
Student(graduate), Person(graduate) {}
std::string Graduate::toString() {
std::stringstream output;
output << Student::toString() << '\n'
<< "רҵ£º" << subject << '\n'
<< "µ¼Ê¦£º{ \n" << adviser.toString() << " \n}" << '\n';
return output.str();
}