Nested If Statement Not displaying Correctly : <p>I am creating Payroll systems for a side project. I am using the nested if statement to see what billing schedule the user selected (52 or 26) then calculate gross pay, taxes and other deductions. The 52 week pay schedule works correctly but the 26 week pay schedule does not display any values. </p>

<pre><code>double hoursWorked = Double.parseDouble(txtHoursWorked.getText());
    double hourlyRate = Double.parseDouble(txtHourlyPay.getText());
    double overtimeHours = Double.parseDouble(txtOvertimeHours.getText());
    double overtimeRate = Double.parseDouble(txtOvertimePay.getText());

    // Declare variables
    double basicPay;
    double overtimePay;
    double grossPay;

    double taxes;
    double yearlyCompensation;
    double cpp;
    double ei;
    double deductions;
    double netPay;


    if (cmbPayPeriod.getSelectedItem().equals("52 Week Pay Period")) {

        grossPay = basicPay + overtimePay;
        txtGrossPay.setText(x.format(grossPay));

        yearlyCompensation = grossPay * 52;

        if (yearlyCompensation &lt; 45282) {

            taxes = (yearlyCompensation * 0.15) / 52;
            cpp = (yearlyCompensation * 0.0495) / 52;
            ei = (yearlyCompensation * 0.0163) / 52;

            deductions = taxes + cpp + ei;

            netPay = grossPay - deductions;

            txtTaxP.setText(x.format(taxes));
            txtCPP.setText(x.format(cpp));
            txtEI.setText(x.format(ei));
            txtDeductions.setText(x.format(deductions));   
            txtNetPay.setText(x.format(netPay));

        }

        else if (yearlyCompensation &lt; 90536) {

            taxes = (yearlyCompensation * 0.205) / 52;
            cpp = (yearlyCompensation * 0.0495) / 52;
            ei = (yearlyCompensation * 0.0163) / 52;

            deductions = taxes + cpp + ei;

            netPay = grossPay - deductions;

            txtTaxP.setText(x.format(taxes));
            txtCPP.setText(x.format(cpp));
            txtEI.setText(x.format(ei));
            txtDeductions.setText(x.format(deductions)); 
            txtNetPay.setText(x.format(netPay));
        }

        else if (yearlyCompensation &lt; 140388) {

            taxes = (yearlyCompensation * 0.265) / 52;
            cpp = (yearlyCompensation * 0.0495) / 52;
            ei = (yearlyCompensation * 0.0163) / 52;

            deductions = taxes + cpp + ei;

            netPay = grossPay - deductions;

            txtTaxP.setText(x.format(taxes));
            txtCPP.setText(x.format(cpp));
            txtEI.setText(x.format(ei));
            txtDeductions.setText(x.format(deductions));  
            txtNetPay.setText(x.format(netPay));
        }

        else if (yearlyCompensation &lt; 200000) {

            taxes = (yearlyCompensation * 0.29) / 52;
            cpp = (yearlyCompensation * 0.0495) / 52;
            ei = (yearlyCompensation * 0.0163) / 52;

            deductions = taxes + cpp + ei;

            netPay = grossPay - deductions;

            txtTaxP.setText(x.format(taxes));
            txtCPP.setText(x.format(cpp));
            txtEI.setText(x.format(ei));
            txtDeductions.setText(x.format(deductions)); 
            txtNetPay.setText(x.format(netPay));
        }

        else {

            taxes = (yearlyCompensation * 0.33) / 52;
            cpp = (yearlyCompensation * 0.0495) / 52;
            ei = (yearlyCompensation * 0.0163) / 52;

            deductions = taxes + cpp + ei;

            netPay = grossPay - deductions;

            txtTaxP.setText(x.format(taxes));
            txtCPP.setText(x.format(cpp));
            txtEI.setText(x.format(ei));
            txtDeductions.setText(x.format(deductions));  
            txtNetPay.setText(x.format(netPay));
        }


    if (cmbPayPeriod.getSelectedItem().equals("n")) {

        grossPay = (basicPay + overtimePay) * 2;
        txtGrossPay.setText(x.format(grossPay));

        yearlyCompensation = grossPay * 26;

        if (yearlyCompensation &lt; 45282) {


            taxes = (yearlyCompensation * 0.15) / 52;
            cpp = (yearlyCompensation * 0.0495) / 52;
            ei = (yearlyCompensation * 0.0163) / 52;

            deductions = taxes + cpp + ei;

            txtTaxP.setText(x.format(taxes));
            txtCPP.setText(x.format(cpp));
            txtEI.setText(x.format(ei));
            txtDeductions.setText(x.format(deductions));     

        }

        else if (yearlyCompensation &lt; 90536) {


            taxes = (yearlyCompensation * 0.205) / 52;
            cpp = (yearlyCompensation * 0.0495) / 52;
            ei = (yearlyCompensation * 0.0163) / 52;

            deductions = taxes + cpp + ei;

            txtTaxP.setText(x.format(taxes));
            txtCPP.setText(x.format(cpp));
            txtEI.setText(x.format(ei));
            txtDeductions.setText(x.format(deductions));  
        }

        else if (yearlyCompensation &lt; 140388) {

            taxes = (yearlyCompensation * 0.265) / 52;
            cpp = (yearlyCompensation * 0.0495) / 52;
            ei = (yearlyCompensation * 0.0163) / 52;

            deductions = taxes + cpp + ei;

            txtTaxP.setText(x.format(taxes));
            txtCPP.setText(x.format(cpp));
            txtEI.setText(x.format(ei));
            txtDeductions.setText(x.format(deductions));  

        }

        else if (yearlyCompensation &lt; 200000) {

            taxes = (yearlyCompensation * 0.29) / 52;
            cpp = (yearlyCompensation * 0.0495) / 52;
            ei = (yearlyCompensation * 0.0163) / 52;

            deductions = taxes + cpp + ei;

            txtTaxP.setText(x.format(taxes));
            txtCPP.setText(x.format(cpp));
            txtEI.setText(x.format(ei));
            txtDeductions.setText(x.format(deductions));  
        }

        else {

            taxes = (yearlyCompensation * 0.33) / 52;
            cpp = (yearlyCompensation * 0.0495) / 52;
            ei = (yearlyCompensation * 0.0163) / 52;

            deductions = taxes + cpp + ei;

            txtTaxP.setText(x.format(taxes));
            txtCPP.setText(x.format(cpp));
            txtEI.setText(x.format(ei));
            txtDeductions.setText(x.format(deductions)); 


        }
    }
    }
</code></pre>
