this might help:
Code:
#include <stdio.h>
int main()
{
float overtime_week_day=14,overtime_weekend=5,total_overtime;
float overtime_weekendpay,overtime_week_daypay,standard_pay, normal_pay;
float over_pay, new_pay1, new_pay2;
float tax1, tax2, tax3,tax;
standard_pay=19.73*35;
total_overtime=overtime_weekend+overtime_week_day;
overtime_weekendpay=overtime_weekend*(1.25*19.73);
overtime_week_daypay=overtime_week_day*(1.5*19.73) ;
over_pay=overtime_weekendpay+overtime_week_daypay;
normal_pay=standard_pay+over_pay;
{
if(normal_pay>=200)
{
tax1=(30/100)*normal_pay;
printf("tax1 = %f\n", tax1);
new_pay1=normal_pay-tax1;
printf("new_pay1 = %f\n", new_pay1);
}
else if(new_pay1>=300)
{
tax2=(40/100)*normal_pay;
printf("tax2 = %f\n", tax2);
new_pay2=new_pay1-tax2;
printf("new_pay2 = %f\n", new_pay2);
}
else if(new_pay2>=0)
{
tax3=(50/100)*new_pay2;
printf("tax3 = %f\n", tax3);
}
tax=tax1+tax2+tax3;
printf("tax = %f\n", tax);
}
printf("\nThe normal week pay is %f, the overtime pay is %f, the tax deduction is %2f\n",normal_pay,over_pay,tax);
return 0;
}