Advertisement
Guest User

code

a guest
Sep 18th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. Scanner scan = new Scanner(System.in);
  2. double grossSalary; int numberOfExemptions; double interestIncome;
  3. double capitalGains; double totalIncome; double adjustedIncome;
  4. double totalTax; double stateTax;
  5. System.out.print("Gross Salary: ");
  6. grossSalary = scan.nextDouble();
  7. System.out.print("Number of Exemptions: ");
  8. numberOfExemptions = scan.nextInt();
  9. System.out.print("Interest Income: ");
  10. interestIncome = scan.nextDouble();
  11. System.out.print("Capital Gains: ");
  12. capitalGains = scan.nextDouble();
  13. totalIncome = grossSalary + interestIncome + capitalGains;
  14. System.out.printf("Total Income: $%.2\f", + totalIncome);
  15. adjustedIncome = totalIncome - (numberOfExemptions * 1800.00);
  16. System.out.printf("Adjusted Income: $%.2\n", adjustedIncome);
  17. // totalTax =
  18. // System.out.printf("Total Tax: $%.2\n", totalTax);
  19. stateTax = adjustedIncome * 0.06;
  20. System.out.printf("State Tax: ", stateTax);
  21. {
  22. if (adjustedIncome <= 10000)
  23. System.out.printf("Total Tax: $%.2\n", "0");
  24. else if (adjustedIncome > 10000 || adjustedIncome <= 25000)
  25. System.out.printf("Total Tax: $%.2\n", adjustedIncome * 0.015);
  26. else if (adjustedIncome > 25000 || adjustedIncome <= 36000)
  27. System.out.printf("Total Tax: $%.2\n", adjustedIncome * 0.25);
  28. else if (adjustedIncome > 36000)
  29. System.out.printf("Total Tax: $%.2\n", adjustedIncome * 0.28);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement