/* * Redmond7inclassex.java * * Created on February 6, 2002, 11:31 PM */ import SavitchIn; /** * * @author mike * @version */ public class Redmond7inclasstestex{ public static final double LOWBRACK = 25000; // 27050; public static final double LOWRATE = .15; public static final double MIDBRACK = 35000; // 38500; // size of the bracket - above the low bracket - going up to 65,550 public static final double MIDRATE = .27; // .275; public static final double HIGHRATE = .31; // .305; /** Creates new Redmond7inclassex*/ public Redmond7inclassex() { } /** * @param args the command line arguments */ public static void main (String args[]) { System.out.println("What is your net income (after deductions)?"); double income = SavitchIn.readLineDouble(); double tax = 0; double remainIncome = income; if (remainIncome > LOWBRACK) { tax += LOWBRACK * LOWRATE; remainIncome = remainIncome - LOWBRACK; } else { tax += remainIncome * LOWRATE; } if (remainIncome > MIDBRACK) { tax += MIDBRACK * MIDRATE; remainIncome = remainIncome - MIDBRACK; } else { tax += remainIncome * MIDRATE; remainIncome = 0; } tax += remainIncome * HIGHRATE; System.out.println("Tax on income: " + income + "\n Tax: " + tax); } }