1  import java.util.Scanner;
  2  
  3  /**
  4     This program calculates a simple tax return.
  5  */
  6  public class TaxCalculator
  7  {  
  8     public static void main(String[] args)
  9     {  
 10        Scanner in = new Scanner(System.in);
 11  
 12        System.out.print("Please enter your income: ");
 13        double income = in.nextDouble();
 14  
 15        System.out.print("Are you married? (Y/N) ");
 16        String input = in.next();
 17        int status;
 18        if (input.equalsIgnoreCase("Y")) 
 19           status = TaxReturn.MARRIED;
 20        else  
 21           status = TaxReturn.SINGLE;
 22  
 23        TaxReturn aTaxReturn = new TaxReturn(income, status);
 24  
 25        System.out.println("Tax: "
 26              + aTaxReturn.getTax());
 27     }
 28  }