请编写Java 程序,计算录入月工资的个人所得税 点击复制后,将打开C知道体验页先计算应纳税所得额 应纳税所得额 = 总工资 - 五险 (一金) 免征额 二、再计算所需缴纳的个人所得税 个人所得税 = 应纳税所得额 X 税率 -速扣数
时间: 2024-06-12 14:08:16 浏览: 169
import java.util.Scanner;
public class IncomeTaxCalculator {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("请输入本月总工资:");
double totalSalary = scanner.nextDouble();
System.out.print("请输入五险一金金额:");
double insurance = scanner.nextDouble();
double exemptAmount = 5000; // 免征额
double taxableIncome = totalSalary - insurance - exemptAmount; // 应纳税所得额
double taxRate = 0; // 税率
double quickDeduction = 0; // 速扣数
if (taxableIncome <= 0) {
System.out.println("您本月无需缴纳个人所得税。");
} else if (taxableIncome <= 36000) {
taxRate = 0.03;
quickDeduction = 0;
} else if (taxableIncome <= 144000) {
taxRate = 0.1;
quickDeduction = 2520;
} else if (taxableIncome <= 300000) {
taxRate = 0.2;
quickDeduction = 16920;
} else if (taxableIncome <= 420000) {
taxRate = 0.25;
quickDeduction = 31920;
} else if (taxableIncome <= 660000) {
taxRate = 0.3;
quickDeduction = 52920;
} else if (taxableIncome <= 960000) {
taxRate = 0.35;
quickDeduction = 85920;
} else {
taxRate = 0.45;
quickDeduction = 181920;
}
double personalIncomeTax = taxableIncome * taxRate - quickDeduction; // 个人所得税
System.out.println("您本月应缴纳个人所得税:" + personalIncomeTax + "元。");
}
}
阅读全文