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.
cpp-work/work20220330/t4/DbTeacher.cpp

25 lines
825 B

//
// 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();
};