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.
25 lines
825 B
25 lines
825 B
3 years ago
|
//
|
||
|
// Created by lensferno on 2022/3/30.
|
||
|
//
|
||
|
|
||
|
#include <sstream>
|
||
|
#include "DbTeacher.h"
|
||
|
|
||
|
|
||
|
DbTeacher::DbTeacher(const Staff &staff, const std::string &title, const std::string &job,
|
||
|
int salary) : Teacher(staff, title), Leader(staff, job), Staff(staff), salary(salary) {}
|
||
|
|
||
|
DbTeacher::DbTeacher(const DbTeacher &dbTeacher) : Teacher(dbTeacher), Leader(dbTeacher), Staff(dbTeacher),
|
||
|
salary(dbTeacher.salary) {}
|
||
|
|
||
|
std::string DbTeacher::toString() {
|
||
|
std::stringstream output;
|
||
|
output
|
||
|
<< "--> as leader:" << '\n'
|
||
|
<< Leader::toString() << '\n'
|
||
|
<< "--> as teacher:" << '\n'
|
||
|
<< Teacher::toString() << '\n'
|
||
|
<< "in DbTeacher:\nsalary:" << salary;
|
||
|
return output.str();
|
||
|
};
|