📄 employee.cpp
字号:
#include "employee.h"
human::human(){
this->name="";
this->age=0;
this->sex="";
}
human::~human(){
}
int human::getAge(){
return this->age;
}
string human::getName(){
return this->name;
}
string human::getSex(){
return this->sex;
}
void human::setAge(int age){
this->age=age;
}
void human::setName(string name){
this->name=name;
}
void human::setSex(string sex){
this->sex=sex;
}
employee::employee(){ //缺省构造函数
this->grade=1;
this->ID=0;
this->payment=0.0;
}
employee::~employee(){
}
int employee::getGrade(){
return this->grade;
}
int employee::getID(){
return this->ID;
}
float employee::getPayment(){
return this->payment;
}
void employee::setGrade(int grade){
this->grade=grade;
}
void employee::setID(int ID){
this->ID=ID;
}
void employee::setPayment(float payment){
this->payment=payment;
}
void employee::Init(istream &in){
in>>name;
in>>sex;
in>>age;
in>>ID;
in>>grade;
in>>payment;
}
void employee::Print(ostream &out){
out<<name<<endl;
out<<sex<<endl;
out<<age<<" "<<ID<<" "<<grade<<" "<<payment<<endl;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -