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.
29 lines
820 B
29 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'
|
|
<< "°à¼¶£º" << 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) {}
|
|
|
|
|