Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class CalculatorOfTaxes
- {
- public static void main(String[] args)
- {
- Scanner scanner = new Scanner(System.in);
- double salary = Double.parseDouble(scanner.nextLine());
- double years = Double.parseDouble(scanner.nextLine());
- double workerTaxes = 1;
- double employerTaxes = 1;
- if (salary < 3000) {
- if (years <= 55) {
- workerTaxes = salary * 0.2;
- }
- else if (years > 55 && years <= 60) {
- workerTaxes = salary * 0.13;
- }
- else if (years > 60 && years <= 65) {
- workerTaxes = salary * 0.075;
- }
- else if (years > 65) {
- workerTaxes = salary * 0.05;
- }
- }
- else if (salary >= 3000) {
- workerTaxes = salary * 0.2;
- //System.out.println(workerTaxes);
- }
- if (salary < 3000) {
- if (years <= 55) {
- employerTaxes = salary * 0.17;
- }
- else if (years > 55 && years <= 60) {
- employerTaxes = salary * 0.13;
- }
- else if (years > 60 && years <= 65) {
- employerTaxes = salary * 0.09;
- }
- else if (years > 65) {
- employerTaxes = salary * 0.075;
- }
- }
- else if (salary >= 3000) {
- employerTaxes = salary * 0.2;
- // System.out.println(employerTaxes);
- }
- System.out.println(workerTaxes);
- System.out.println(employerTaxes);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement