Need help with salary deductions and overtime

Hey guys, i've been stuck in this rut for weeks and i've been trying to make a salary pay for c++ with deductions to the tax and increase if the user exceeded 80 days (anything more than 80 is considered overtime)

overtime is the salary 150% exceeding 80.

i know it's wrong :( i dont know how to correct it.

#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
int empnum,salary,sss,tax,abs,tardiness,hrsworked;
string name,position;

double deduction,deduc,ot_rate,ot_time;



cout<<"FirstSource UK \n";
cout<<"London, United Kingdom \n";
cout<<"Pay Period: September 1,15,2011" <<endl;
cout << "Employee Number:";
cin >> empnum;
cout << "Name:" ;
cin >> name;
cout << "Position:";
cin >> position;
cout << "Basic Salary:";
cin >>salary;
cout<<"Hours worked:";
cin>>hrsworked;
if (hrsworked>80)
{
cout << "Enter your overtime rate (ave. x1.5 or 150%):";
cin >> ot_rate;

ot_rate = salary*1.5;

cout << "Enter your hours worked overtime;";
cin >> ot_time;


}
cout << "Absences:";
cin >> abs;

cout << "Deduction \n";
if (salary<=1000)
{
cout << "Your SSS Deduction is 1%:" <<endl;

}
else if (salary<=5000)
{
cout << "Your SSS Deduction is 3%" <<endl;
}
else if (salary<=10000)
{
cout << "Your SSS Deduction is 4%"<<endl;
}
else if (salary<=15000)
{
cout << "Your Tax Deduction is 7%"<<endl;
}
if (salary<=10000)
{
cout << "Your Tax Deduction is 5%" <<endl;

}
else if (salary<=15000)
{
cout << "Your Tax Deduction is 6%" <<endl;
}
else if (salary<=20000)
{
cout << "Your Tax Deduction is 8%"<<endl;
}
else if (salary<=30000)
{
cout << "Your Tax Deduction is 9% "<<endl;
}


cout <<"Absent:" <<abs <<endl;

cout <<"Tardiness:" << abs <<endl;

cout << "Total Deduction"<<endl;
if (salary<=10000)
{
cout << "Your total deduction is 600 Pesos " <<endl;

}
else if (salary<=15000)
{
cout << "Your total deduction is 12000 Pesos" <<endl;
}
else if (salary<=20000)
{
cout << "Your total deduction is 2000 Pesos"<<endl;
}
else if (salary<=30000)
{
cout << "Your total deduction is 3400 Pesos"<<endl;
}

if(salary<=1000)
{
deduc=600;
cout << "Netpay"<<deduction <<endl;
deduction=salary-deduc;
}

else if (salary<=15000)
{
deduc=1200;
cout <<"Netpay" <<deduction <<endl;
deduction=salary-deduc;
}
else if (salary<=20000)
{

deduc=2000;
cout<<"Netpay" <<deduction <<endl;
deduction=salary-deduc;
}
else if (salary<=30000)
{
deduc=3400;
cout<<"Netpay" <<deduction <<endl;
deduction=salary-deduc;
}


system("PAUSE");
return EXIT_SUCCESS;

}


thank you for your time :)
Last edited on
Could you say exactly what your problem is?

Also, could you use code tags, it makes it a lot easier to read :)
Last edited on
Topic archived. No new replies allowed.