Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Scanner scan = new Scanner(System.in);
- double grossSalary; int numberOfExemptions; double interestIncome;
- double capitalGains; double totalIncome; double adjustedIncome;
- double totalTax; double stateTax;
- System.out.print("Gross Salary: ");
- grossSalary = scan.nextDouble();
- System.out.print("Number of Exemptions: ");
- numberOfExemptions = scan.nextInt();
- System.out.print("Interest Income: ");
- interestIncome = scan.nextDouble();
- System.out.print("Capital Gains: ");
- capitalGains = scan.nextDouble();
- totalIncome = grossSalary + interestIncome + capitalGains;
- System.out.printf("Total Income: $%.2\f", + totalIncome);
- adjustedIncome = totalIncome - (numberOfExemptions * 1800.00);
- System.out.printf("Adjusted Income: $%.2\n", adjustedIncome);
- // totalTax =
- // System.out.printf("Total Tax: $%.2\n", totalTax);
- stateTax = adjustedIncome * 0.06;
- System.out.printf("State Tax: ", stateTax);
- {
- if (adjustedIncome <= 10000)
- System.out.printf("Total Tax: $%.2\n", "0");
- else if (adjustedIncome > 10000 || adjustedIncome <= 25000)
- System.out.printf("Total Tax: $%.2\n", adjustedIncome * 0.015);
- else if (adjustedIncome > 25000 || adjustedIncome <= 36000)
- System.out.printf("Total Tax: $%.2\n", adjustedIncome * 0.25);
- else if (adjustedIncome > 36000)
- System.out.printf("Total Tax: $%.2\n", adjustedIncome * 0.28);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement