I'm working on a program that will calculate gross pay and net pay after taxes in C : I'm working on a project for a class that has me calculate gross pay, overtime pay, and net pay after taxes. Anything below $600 is taxed at 15% and anything above $600 is taxed at 20%.  I believe I have all of my calculations correct; however, when I run the program it gives me incorrect answers.  When I input hours worked at 45 and a wage of $15.25 I should get a gross pay of $724.38 and a net pay of $659.26.  Instead, I'm returning a result of a net pay of $712.50 and a net pay of $645.00.  Rather odd.  Here's the code I got.

    #include<stdio.h>

    int main(void){

    int hoursWorked, hourlyWage;
    float grossPay, netPay, overHours;

    printf("Please input number of hours worked. ");
    scanf(" %i", &hoursWorked);

    printf("Please input your hourly wage. ");
    scanf(" %i", &hourlyWage);

    if(hoursWorked <= 40){
        grossPay = hourlyWage * hoursWorked;
    }
    else{
        if(hoursWorked > 40){
            overHours = hoursWorked - 40;
            grossPay = (overHours * (hourlyWage * 1.5)+ (hourlyWage * 40));
        }
    }
    if(grossPay <= 600){
        netPay = (grossPay - (grossPay * .15));
    }
    else{
        if(grossPay > 600){
            netPay = (grossPay - (600 * .15) + ((grossPay - 600) * .2));
        }
    }
    printf("Your gross pay was $%.2f", grossPay);
    printf("\nAnd your net pay was $%.2f after taxes", netPay);

    return 0;
}


