小型公司工资管理系统(C++)源代码
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
#include
#include
#include
#include
class Employ//基类-雇员类
{
protected:
int num;
char name[10];
char sex;
int age;
int wage;
public:
virtual void set()=0;
virtual void print()=0;
virtual void reserved()=0;
};
class Manager:public Employ//经理类
{
public:
void set();
void print();
void reserved();
};
class Salesman:public Employ//销售员类
{
protected:
int salesvolume;
int snum;
public:
void set();
void print();
void reserved();
void printinfor();
int getsales()
{return salesvolume;}
int getsnum()
{return snum;}
};
class MarketMan:public Manager//销售经理类{
protected:
int salesvolume;
public:
void set();
void print();
void reserved();
int resetwage();
int getnum()
{return num;}
char*getname()
{return name;}
int getamount(Salesman s[],int n)
{
salesvolume=0;
for(int i=0;i {if(s[i].getsnum()==num) salesvolume+=s[i].getsales();} return salesvolume; } }; class Technician:public Employ//技术员类{ protected: int worktime; public: void set(); void print(); void reserved(); }; void Manager::set() { wage=8000; cout<<"经理的编号:"; cin>>num; cout<<"其姓名:"; cin>>name; cout<<"性别(m/w):"; cin>>sex; cout<<"年龄:"; cin>>age; } void Manager::print()//经理类成员函数 { cout<<"┣━━━━━━╋━━━━━━╋━━━━━━╋━━━━━━╋━━━━━━┫"< cout<<"┃"< cout<<"┃"< } void Manager::reserved() { ofstream employf("E:\\05-29\\gzglxt.txt",ios::app); employf<<"经理的编号:"< <<"其姓名:"< <<"性别(m/w):"< <<"年龄:"< } void MarketMan::set() wage=resetwage(); cout<<"销售经理的编号:"; cin>>num; cout<<"其姓名:"; cin>>name; cout<<"性别(m/w):"; cin>>sex; cout<<"年龄:"; cin>>age; } void MarketMan::print() { resetwage(); cout<<"┣━━━━━━╋━━━━━━╋━━━━━━╋━━━━━━╋━━━━━━┫"< cout<<"┃"< cout<<"┃"< } void MarketMan::reserved()