[java]代码库
public static void main(String[] args) {
double income,tax;
Scanner in=new Scanner(System.in);
System.out.print("请输入你的个人收入: ");
income=in.nextDouble();
tax=0;
int number=0;
if( income <=1800)
number =0;
else if( income <=5000)
number =1;
else if( income <=10000)
number =2;
else
number =3;
switch(number){
case 0:System.out.println("免税.");
break;
case 1:tax=(income-1800)*0.2;
break;
case 2:tax=(5000-1800)*0.2+(income-5000)*0.35;
break;
case 3:tax=(5000-1800)*0.2+(10000-5000)*0.35+(income-10000)*0.5;
break;
default:
}
System.out.println("你的个人收入所得税额为:"+tax);
}
}