import java.util.*;

public class TaxCalculatorCUI
{  public static void main(String[] args)
   {  Scanner kbd = new Scanner(System.in);
      boolean q=false;
      do
      {  System.out.println("Enter Income or type \"q\" to quit.");
         try
         {  float fTax = Math.abs(TaxCalculator.tax(kbd.nextFloat()));
         	System.out.println("Tax = " + fTax);
         }
         catch(Exception InputMismatchException)
         {  if(kbd.next().equalsIgnoreCase("q"))
               q = true;
            else
               System.out.println("Improper input.");
         }
      }while(!q);
}  }