当前位置: 代码迷 >> C++ >> 求人事管理管理系统代码,该怎么解决
  详细解决方案

求人事管理管理系统代码,该怎么解决

热度:8714   发布时间:2013-02-26 00:00:00.0
求人事管理管理系统代码
做完就好放假了,求人事管理管理系统。。。!!!

------解决方案--------------------------------------------------------
看看CSDN有没有
------解决方案--------------------------------------------------------

#include <iostream>
#include <string>
#include <iomanip>
#include <fstream>
using namespace std;

class Person
{
protected:
string name,ID,sex,job;
int age;
double Sumsalary;
public:
Person();
string getID(){return ID;}
string getName(){return name;}
string getSex(){return sex;}
string getJob(){ return job;}
int getAge(){return age;}
double getSumsalary(){ return Sumsalary;}
void InputPerson();
virtual double getpay()=0;
friend ostream &operator <<(ostream &os,Person &In);
};
Person::Person()
{
ID="000000";
name="No Name";
age=0;
sex="No sex";
Sumsalary=0;
job="Wei zhi";
}
void Person::InputPerson()
{
cout<<"Please input ID:"<<endl;
cin>>ID;
cout<<"Plaese input name:"<<endl;
cin>>name;
cout<<"Plaese input age:"<<endl;
cin>>age;
cout<<"Plaese input sex:"<<endl;
cin>>sex;
}

ostream & operator<<(ostream &os,Person &In)
{
os<<In.ID<<" "<<In.name<<" "<<In.job<<" "<<In.age<<" "<<In.sex<<" "<<In.getpay()<<endl;
return os;
}

class Boss:public Person
{
double salary;
int year;
public:
Boss();
void Input();
virtual double getpay();
};
Boss::Boss()
{
job="Boss";
salary=150000.0;
year=0;
}
void Boss::Input()
{
InputPerson();
cout<<"Please input Salary:"<<endl;
cin>>salary;
cout<<"Please input Year:"<<endl;
cin>>year;
}
double Boss::getpay()
{
return Sumsalary=salary*year;
}

class Employee:public Person
{
double salary,bonus;
int month;
public:
Employee();
void Input();
virtual double getpay();
};
Employee::Employee()
{
job="Employee";
salary=2000;
bonus=500;
month=0;
}
void Employee::Input()
{
InputPerson();
cout<<"Please input Salary:"<<endl;
cin>>salary;
cout<<"Please input Bonus:"<<endl;
cin>>bonus;
cout<<"Please input Month:"<<endl;
cin>>month;
}
double Employee::getpay()
{
return Sumsalary=(salary+bonus)*month ;
}

class Hourly_Worker :public Person
{
double salary;
int hour;
public:
Hourly_Worker();
void Input();
virtual double getpay();
};
Hourly_Worker::Hourly_Worker()
{
job="Hourly_Worker";
salary=15;
hour=0;
}
void Hourly_Worker::Input()
{
InputPerson();
cout<<"Please input Salary:"<<endl;
cin>>salary;
cout<<"Please input Hour:"<<endl;
cin>>hour;
  相关解决方案