01: import java.util.Scanner;
02: 
03: /**
04:    A class to test the TaxReturn class.
05: */
06: public class TaxReturnTester
07: {  
08:    public static void main(String[] args)
09:    {  
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("Please enter S (single) or M (married): ");
16:       String input = in.next();
17:       int status = 0;
18: 
19:       if (input.equalsIgnoreCase("S")) 
20:          status = TaxReturn.SINGLE;
21:       else if (input.equalsIgnoreCase("M")) 
22:          status = TaxReturn.MARRIED;
23:       else 
24:       {
25:          System.out.println("Bad input.");
26:          return;
27:       }      
28: 
29:       TaxReturn aTaxReturn = new TaxReturn(income, status);
30: 
31:       System.out.println("The tax is "
32:             + aTaxReturn.getTax());
33:    }
34: }