java作业
public class Tax {
public static void main(String[] args) {
//用户输入薪水
Scanner sc=new Scanner(System.in);
System.out.println("请输入你本月所获薪水");
int salary=sc.nextInt();
//计算
double tax;
if (salary <= 5000) {
tax = 0;
} else if (salary <= 8000) {
tax = (salary - 5000) * 0.03;
} else if (salary <= 17000) {
tax = (salary - 8000) * 0.1 + 3000;
} else if (salary <= 30000) {
tax = (salary - 17000) * 0.2 + 3000 + 9000;
} else if (salary <= 40000) {
tax = (salary - 30000) * 0.25 + 3000 + 9000 + 26000;
} else if (salary <= 60000) {
tax = (salary - 40000) * 0.3 + 3000 + 9000 + 26000 + 25000;
} else if (salary <= 85000) {
tax = (salary - 60000) * 0.35 + 3000 + 9000 + 26000 + 25000 + 60000;
} else {
tax = (salary - 85000) * 0.45 + 3000 + 9000 + 26000 + 25000 + 60000 + 63000 ;
}
System.out.print("您适用的个人所得税为:"+tax);
}
}