MyException - 我的异常网
当前位置:我的异常网» C++ » 求人事管理管理系统代码,该怎么解决

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

www.MyException.Cn  网友分享于:2013-02-16  浏览:5次
求人事管理管理系统代码
做完就好放假了,求人事管理管理系统。。。!!!

------解决方案--------------------
看看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;

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有