/*****************************************************************
** TaxRate - program to demonstrate the switch statement
**
** This program prompts the user to enter his/her income bracket.
** The output is the corresponding taxes (in percent) that are due.
**
** A sample dialogue is
**
**       PROMPT>java TaxRate
**       What is your income bracket?
**       1. less than 25K
**       2. 25K to 50K
**       3. more than 50K
**       Enter: 2
**       Pay 20% taxes
**
** (c) Scott MacKenzie, 2000                             
******************************************************************/
import java.io.*;

public class TaxRate
{
   public static void main(String[] args) throws IOException
   {
      BufferedReader stdin =
         new BufferedReader(new InputStreamReader(System.in), 1);

      System.out.println("What is your income bracket?");
      System.out.println("1 = less than 25K");
      System.out.println("2 = 25K to 50K");
      System.out.println("3 = more than 50K");
      System.out.print("Enter: ");
      int bracket = Integer.parseInt(stdin.readLine());
      switch (bracket)
      {
         case 1:
            System.out.println("Pay no taxes");
            break;
         case 2:
            System.out.println("Pay 20% taxes");
            break;
         case 3:
            System.out.println("Pay 30% taxes");
            break;
         default:
            System.out.println("Error: bad input");
      }
   }
}

