#include <iostream>
using namespace std;
class Wages
{
double base;
double bonus;
double tax;
public:
Wages(double cBase,double cBonus,double cTax):base(cBase),bonus(cBonus),tax(cTax){}
double getPay()const;
Wages operator+(Wages w)const;
};
double Wages::getPay()const
{
return base+bonus-tax;
}
Wages Wages::operator+(Wages w)const
{
return Wages(base+w.base,bonus+w.bonus,tax+w.tax);
}
int main()
{
Wages w1(2000,500,100),w2(5000,1000,300);
cout<<(w1+w2).getPay()<<endl;
return 0;
}