Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class CalculatorOfTaxes
  4. {
  5. public static void main(String[] args)
  6. {
  7. Scanner scanner = new Scanner(System.in);
  8. double salary = Double.parseDouble(scanner.nextLine());
  9. double years = Double.parseDouble(scanner.nextLine());
  10. double workerTaxes = 1;
  11. double employerTaxes = 1;
  12.  
  13. if (salary < 3000) {
  14. if (years <= 55) {
  15. workerTaxes = salary * 0.2;
  16. }
  17. else if (years > 55 && years <= 60) {
  18. workerTaxes = salary * 0.13;
  19. }
  20. else if (years > 60 && years <= 65) {
  21. workerTaxes = salary * 0.075;
  22. }
  23. else if (years > 65) {
  24. workerTaxes = salary * 0.05;
  25. }
  26. }
  27. else if (salary >= 3000) {
  28. workerTaxes = salary * 0.2;
  29. //System.out.println(workerTaxes);
  30. }
  31. if (salary < 3000) {
  32. if (years <= 55) {
  33. employerTaxes = salary * 0.17;
  34. }
  35. else if (years > 55 && years <= 60) {
  36. employerTaxes = salary * 0.13;
  37. }
  38. else if (years > 60 && years <= 65) {
  39. employerTaxes = salary * 0.09;
  40. }
  41. else if (years > 65) {
  42. employerTaxes = salary * 0.075;
  43. }
  44. }
  45. else if (salary >= 3000) {
  46. employerTaxes = salary * 0.2;
  47. // System.out.println(employerTaxes);
  48. }
  49. System.out.println(workerTaxes);
  50. System.out.println(employerTaxes);
  51.  
  52.  
  53.  
  54. }
  55.  
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement