Introduction - If you have any usage issues, please Google them yourself
1 a unit of wages including basic wage Wage, job subsidies Subsidy, rent Rent, water WaterFee, electricity ElecFee. Design is to achieve the payroll of the class Salary, such forms as follows:
Class Salary {
Double Wage, Subsidy, Rent, WaterFee, ElecFee
Pulic:
Salary (... ...) {initialize the wage data of the sub-}
Salary () {initialize the wage data of the sub-data to 0}
Void setXX (double f) {xx = f }
Double getXX () {return xx }
Double RealSalary ()// calculate the real wages
}
Among them, the member function used to set wages setXX the sub-data, member functions getXX used to obtain the wage data in the sub, xx on behalf of Wage, Subsidy and other data members.
Real wages = Wage Subsidy-Rent-WaterFee-ElecFee
Improve the design of such programming, and testing of such a member function to write the main function main.
(2) design of the workers class Worker, it has the name name, age, age, department Dept, salary wages and other data members.