?? employee.cpp
字號(hào):
#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(){ //缺省構(gòu)造函數(shù)
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;
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -