double hours=0, rate=0; 
    double Federaltaxes, Ficataxes, Statetaxes;
    double netpay=0, grosspay=0, totaltaxes;
    if (hours <= 40){
    System.out.println("how many hours did you work");
    hours= input.nextDouble();
    System.out.println("what is the rate you get paid");
    rate= input.nextDouble();
    grosspay= hours * rate;
    System.out.println("the gross pay is:" + grosspay);
    Federaltaxes= grosspay * .20;
        System.out.println("Federal taxes are:" + Federaltaxes);
        Ficataxes= grosspay * .10;
        System.out.println("Fica taxes  are:" + Ficataxes);
        Statetaxes= grosspay * .05;
        System.out.println("State taxes are:" + Statetaxes);
        totaltaxes = Federaltaxes + Ficataxes + Statetaxes;
        System.out.println("total taxes paid are:" + totaltaxes );
        netpay= grosspay - totaltaxes;
        System.out.println("net pay is:" + netpay);
    }
    else grosspay= (40*rate) + ((1.5*rate)*(hours-40));

Put the if statement at the bottom of your code
If (hours >40)
grosspay= (40 * rate) + ((1.5 * rate)*(hours-40));

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.