1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
ofstream fout;
class Salary
{
float basic,gross,deduction,da,hra,ot,oth,pf,lic,fadv,coops,hdfc,netpay;
int abdys;
public:
void add();
}sal;
void Salary::add()
{employee::add();
cout<<"\n\n\tBasic Pay: ";
cin>>basic;
cout<<"\n\n\tDays Absent: ";
cin>>abdys;
cout<<"\n\n\tOvertime Hours: ";
cin>>oth;
cout<<"\n\n\tLoans and Savings\n";
cout<<"\n\n\tLIC: ";
cin>>lic;
cout<<"\n\n\tHDFC: ";
cin>>hdfc;
cout<<"\n\n\tCo Operative Society: ";
cin>>coops;
calculate();
fout.write((char *)&sal,sizeof(sal));
fout.close();
}
|