public class IncomeTaxCalculator {
   public static void main(String[] args) {
      
      
      final double TAX_RATE_ABOVE_20K = 0.1;
      final double TAX_RATE_ABOVE_40K = 0.2;
      final double TAX_RATE_ABOVE_60K = 0.3;

      int taxableIncome;
      double taxPayable;

      //declare a Scanner variable
      Scanner kbin = new Scanner(System.in);
      
      //prompt the user
      System.out.print("Enter the taxable income: $");
      
      //get integer from keyboard and assign to a variable
      taxableIncome = kbin.nextInt();
      
      kbin.close(); //close the Scanner, optional

      
      if (taxableIncome <= 20000) {
         taxPayable = 0;
      } else if (taxableIncome <= 40000) { 
         taxPayable = taxableIncome * TAX_RATE_ABOVE_20K;
      } else if (taxableIncome <= 60000) { 
         taxPayable = taxableIncome * TAX_RATE_ABOVE_40K;
      } else {                              
         taxPayable = taxableIncome * TAX_RATE_ABOVE_60K;
      }

      System.out.printf("The income tax payable is: $%.2f%n", taxPayable);
   }
}