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:

TaxReturn.java

Use the following file:

TaxCalculator.java

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.in);

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

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

      TaxReturn aTaxReturn = new TaxReturn(income, status);

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