1.程序代码如下:
package java实训;
import java.util.Scanner;
public class SJ3 {
public static void main(String[] args) {
float shui =0;
Scanner input =new Scanner(System.in);
System.out.println("请输入你本月的工资: ");
int gz= input.nextInt();
if(gz<800)
{
shui=0;
System.out.println("你的收入未达到收税标准,不用交税!");
}
else if(800<gz&&gz<=5000)
{
shui=(float) (gz*0.03);
}
else if(gz>5000)
{
shui= (float) ((gz-5000)*0.2+(5000-800)*0.03);
}
System.out.println("应收个人所得税为:"+shui);
}
}
2.程序运行截图: