Change the implementation of the getTax method in the TaxReturn class, by setting a variable rate1Limit, depending on the marital status. Then have a single formula that computes the tax, depending on the income and the limit. Verify that your results are identical to that of the TaxReturn class in this chapter.

Complete the following file:

Use the following file:

import java.util.Scanner;

   This program calculates a simple tax return.
public class TaxCalculator
   public static void main(String[] args)
      Scanner in = new Scanner(;

      System.out.println("Please enter your income: ");
      double income = in.nextDouble();

      System.out.println("Are you married? (Y/N)");
      String input =;
      int status;
      if (input.equalsIgnoreCase("Y")) 
         status = TaxReturn.MARRIED;
         status = TaxReturn.SINGLE;

      TaxReturn aTaxReturn = new TaxReturn(income, status);

      System.out.println("Tax: " + aTaxReturn.getTax());