个人所得税计算
public class TaxCalculation { public static void main(String[] args) { String a = JOptionPane.showInputDialog("请输入你的收入工资:"); String b = JOptionPane.showInputDialog("请输入你的五险一金:"); double salary = Double.parseDouble(a); double insurance = Double.parseDouble(b); salary = salary - insurance - 3500; if (salary <= 0) { JOptionPane.showMessageDialog(null, "你不需要缴纳个人所得税!"); } else if (salary <= 1500) { JOptionPane.showMessageDialog(null, "你需要缴纳个人所得税为:" + (salary * 0.03)); } else if (salary <= 4500) { JOptionPane.showMessageDialog(null, "你需要缴纳个人所得税为:" + (salary * 0.1 - 105)); } else if (salary <= 9500) { JOptionPane.showMessageDialog(null, "你需要缴纳个人所得税为:" + (salary * 0.2 - 555)); } else if (salary <= 35000) { JOptionPane.showMessageDialog(null, "你需要缴纳个人所得税为:" + (salary * 0.25 - 1005)); } else if (salary <= 55000) { JOptionPane.showMessageDialog(null, "你需要缴纳个人所得税为:" + (salary * 0.3 - 2755)); } else if (salary <= 80000) { JOptionPane.showMessageDialog(null, "你需要缴纳个人所得税为:" + (salary * 0.35 - 5505)); } else if (salary < 80000) { JOptionPane.showMessageDialog(null, "你需要缴纳个人所得税为:" + (salary * 0.45 - 13505)); } } }