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.

30 lines
820 B

#include <iostream>
#include <sstream>
#include "Student.h"
Student::Student(int classId, const Person &person) : classId(classId), Person(person) {}
Student::Student(const Student &student) : classId(student.classId), Person(student) {}
int Student::getClassId() const {
return classId;
}
void Student::setClassId(int classId) {
Student::classId = classId;
}
std::string Student::toString() {
std::stringstream output;
output
<< Person::toString() << '\n'
<< "<EFBFBD><EFBFBD><EFBFBD>" << classId;
return output.str();
}
Student::Student(const std::string &id, const std::string &name, char sex, const std::string &identNumber,
const Date &birthday, int classId)
: Person(id, name, sex, identNumber, birthday), classId(classId) {}