涉及类于对象的小程序,不知道错哪,求解
#include <iostream>using namespace std;
class Salary{
private:
double Wage,Subsidy,Rent,WaterFee,ElecFee;
public:
Salary(double a,double b,double c,double d,double e){Wage=a;Subsidy=b;Rent=c;WaterFee=d;ElecFee=e;}
Salary(){Wage=0;Subsidy=0;Rent=0;WaterFee=0;ElecFee=0;}
void setWage(double a){Wage=a;}
void setSubsidy(double b){Subsidy=b;}
void setRent(double c){Rent=c;}
void setWaterFee(double d){WaterFee=d;}
void setElecFee(double e){ElecFee=e;}
double getWage(){return Wage;}
double getSubsidy(){return Subsidy;}
double getRent(){return Rent;}
double getWaterFee{return WaterFee;}
double getElecFee(){return ElecFee;}
double RealSalary(Salary s);
};
double RealSalary(Salary s)
{
double x;
x=s.getWage()+s.getSubsidy()-s.getRent()-s.getWaterFee-s.getElecFee();
return x;
}
void main()
{
Salary s;
Salary s1(10,124,10,45,4);
cout<<"RealSalary(s)"<<endl;
}