employee.cpp

来自「一个简单的教师职工管理系统」· C++ 代码 · 共 72 行

CPP
72
字号

#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 + =
减小字号Ctrl + -
显示快捷键?