1、#includeusing namespace std;class Emploryeeprotected:char Name10;char Num5;int Work_Age;double Totle_Salary;public:virtual void Get_Message();virtual void Pay()=0;void Show_Message();class Manager:virtual public Emploryeeprotected:float Salary;public:Manager();void Get_Message();void Pay();Manager()
2、;class Worker:public Emploryeeprotected:float Salary;int Work_Hour;public:Worker();void Get_Message();void Pay();Worker();class Sell:virtual public Emploryeeprotected:float Sale;public:Sell();void Get_Message();void Pay();Sell();class Sell_Manager:public Sell,public Managerpublic:Sell_Manager();void
3、 Get_Message();void Pay();Sell_Manager();void Emploryee:Get_Message()coutName;coutNum;void Emploryee:Show_Message()coutendl姓名:Name;coutendl编号:Num;coutendl总工资Totle_Salary;void Manager:Get_Message()Emploryee:Get_Message();coutSalary;coutWork_Age;coutendl;void Manager:Pay()Totle_Salary=Salary+Work_Age*
4、50;void Worker:Get_Message()Emploryee:Get_Message();coutSalary;coutWork_Hour;coutWork_Age;void Worker:Pay()Totle_Salary=Salary+Work_Hour*100+Work_Age*50;void Sell:Get_Message()Emploryee:Get_Message();coutWork_Age;coutSale;coutendl;void Sell:Pay()Totle_Salary=Work_Age*50+Sale*0.05;void Sell_Manager:G
5、et_Message()Emploryee:Get_Message();coutSalary;coutWork_Age;coutSale;coutendl;void Sell_Manager:Pay()Totle_Salary=Salary+Work_Age*50+Sale*0.05;void main()char yn;int n;/Emploryee *s4=new Manager,new Worker,new Sell,new Sell_Manager;Emploryee *s4;s0=new Manager ;s1=new Worker;s2=new Sell;s3=new Sell_Manager;while(1)coutendl请选择要计算的工资种类:endlendl;cout0-经理endl;cout1-工人endl;cout2-销售员endl;cout3-销售经理endl;coutn;coutGet_Message();sn-Pay();sn-Show_Message();coutendlendlyn;if(yn!=Y&yn!=y)break;system(cls);