package com.company; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); final int tax1 = 10; final int tax2 = 20; final int tax3 = 30; final int tax4 = 40; final int tax5 = 50; final int step1 = 23_000; final int step2 = 46_000; final int step3 = 74_000; final int step4 = 120_000; double income = 0; double tax = 0; System.out.println("Please enter your name: "); String name = input.next(); System.out.println("Please enter your income: "); income = input.nextInt(); double temp = income; if (income > 0) { temp = income / tax1; if (income > step1) { temp += (income - step1) / tax2; if (income > step2) { temp += (income - step2) / tax3; if (income > step3) { temp += (income - step3) / tax4; if (income > step4) { temp += (income - step4) / tax5; } } } } } System.out.println("the tax you need to pay is : " + temp); } }