Requirements:
(1) The data members included in the staff class are numbered (num), name (name), attendance (rateofattend), base salary (Basicsal), and bonus (prize). The Saleman class also includes a data member salesperson percentage (deductrate) and personal sales (Personamount), which also includes the data member Manager royalty ratio (totaldeductrate) and the total sales in the manager class ( TotalAmount). No other data members are included in the Salemanager class.
(2) The wage formula for all types of personnel is as follows:
Employee Real wages = Basic Salary + Bonus * Attendance
Salesperson's Real salary = Basic Salary + Bonus * attendance + personal Sales * Percentage of sales Staff
Manager Real Salary = Basic Salary + Bonus * attendance + total Sales * Percentage of the manager's commission
Sales Manager Real Salary = Basic Salary + Bonus * attendance + Personal Sales * Sales Commission ratio + total sales * Percentage of commission
(3) Each class has constructors, outputs basic information functions (output) and output real-wage functions (outputwage).
#include "iostream" USINGNAMESPACESTD; classstaff{Private:intnum charname[18]; doublerateofattend; intbasicsal; intprize; Public:staff (Inta,char*b, doublec,intd,inte): Num (a), Rateofattend (c), Basicsal (d), Prize (e) {strcpy (name,b);} voidoutput () {Cout<<num << "<<name<<" "<<rateofattend<<" "<<basicSal<<" "<<prize<<" "; } Doubleoutputwage () {return (basicsal+prize*rateofattend);}}; classsalemen:virtualpublicstaff{private:doubledeductrate; doublepersonamount; Public:salemen (Inta,char*b,doublec , Intd,inte,doublef,doubleg): Staff (A,b,c,d,e), Deductrate (f), Personamount (g) {}; Voidoutput () {staff::output (); cout<<deductrate<< "<<personAmount<<";} voiddisplay () { cout<<deductrate<< "" <<personAmount<< ""; } doubleoutputwage () {return (Staff::outputwage () +deductrate*personamount);}}; classmanager:virtualpublicstaff{private:doubletotaldeductrate; Doubletotalamount Public:manager (Inta,char*b,Doublec,intd,inte,doublef,doubleg): Staff (A,b,c,d,e), Totaldeductrate (f), TotalAmount (g) {}; Voidoutput () {staff::output (); cout<<totaldeductrate<< "" <<totalAmount<< ";} voiddisplay () {cout<<totaldeductrate<< "" <<totalAmount<< "";} Doubleoutputwage () {return (Staff::outputwage () +totaldeductrate*totalamount);}; Classsalemanager:publicsalemen,publicmanager {Public:salemanager (Inta,char*b,doublec,intd,inte,doublef,doubleg, Doubleh,doublei): Salemen (A,b,c,d,e,h,i), Manager (A,b,c,d,e,f,g), Staff (a,b,c,d,e) {} voidoutput () {staff::output (); Salemen::d isplay (); Manager::d isplay (); } doubleoutputwage () {return (Salemen::outputwage () +manager::outputwage ()-staff::outputwage ());}; Voidmain () {Staffa (1, "Liu", 1,1000,500); A.output (); A.outputwage (); cout<<endl; Salemenb (2, "L", 0.5,1000,500,5000,0.5); B.output (); B.outputwage (); cout<<endl; MANAGERC (3, "pp", 0.5,1000,500,5000,0.5); C.output (); C.outputwage (); cout<<endl; Salemanagerd (4, "P",0.5,1000,500,0.5,10000,0.5,3000); D.output (); D.outputwage (); cout<<endl; }