I can't find the logic error in this easy piece of code. Java language, simple math program
<p>This is a program that is supposed to prompt user for hours worked and hourly
rate of pay, and calculate and display their net pay (including taxes deducted).</p>

<p>I can get this working, but i get the wrong answer and i cant figure out where my logic error is. Please lend a hand and use your expertise. Thanks alot STACK OVERFLOW</p>

<pre><code>import java.util.*;
public class HA8PayrollErr {
    public static void main(String[] args){
    float hoursWorked;
    float ratePay;

    float basePay = 0.0f;
    float overtimePay = 0.0f;
    float totalPay = 0.0f;
    float taxDeducted = 0.0f;
    float netPay = 0.0f;

    int doAgain = 0;
    Scanner input = new Scanner(System.in);

    do {
        System.out.println("Enter hours worked this week"); 
        hoursWorked = input.nextFloat();
        System.out.println("Enter rate of pay");
        ratePay = input.nextFloat();

        if (hoursWorked &gt; 37.5f) {
            basePay = 37.5f*ratePay;
            overtimePay = (hoursWorked - 37.5f) * ratePay * 1.5f;
        } else {
            basePay = hoursWorked * ratePay;
        }
        totalPay = basePay + overtimePay;
        if (totalPay &lt; 1000) 
            taxDeducted = 0;
        else if (totalPay &gt; 2000)
            taxDeducted = totalPay *0.30f;
        else taxDeducted = totalPay * 0.20f;

        netPay = totalPay - taxDeducted;

        System.out.println ("Base pay is : $" + basePay);
        System.out.println ("Overtime pay is : $"+ overtimePay);
        System.out.println ("Tax deducted is : $" + taxDeducted);
        System.out.println ("Net pay is : $" + netPay);

        System.out.println ("Enter 0 to repeat, or 1 to quit: ");
        doAgain = input.nextInt();
    } while (doAgain == 0);
    }
}
</code></pre>
