yuedan628
 1 package com.lovo;
 2 
 3 import java.util.Scanner;
 4 
 5 public class payrollManagementSystem {
 6 
 7     //税率
 8     private static final double tariff1 = 0.03;
 9     private static final double tariff2 = 0.1;
10     private static final double tariff3 = 0.2;
11     private static final double tariff4 = 0.25;
12     private static final double tariff5 = 0.3;
13     private static final double tariff6 = 0.35;
14     private static final double tariff7 = 0.45;
15     //个税起征点
16     private static final double taxThreshold = 3500;
17     
18     public static void main(String[] args) {
19     
20         Scanner sc = new Scanner(System.in);
21         System.out.print("请输入您的薪资:");
22         double salary = sc.nextDouble();
23         System.out.print("请输入您的五险一金:");
24         double fiveInsurancePayments = sc.nextDouble();
25         
26         //个人所得税
27         double personalIncomeTax = 0.0000;
28         if(salary <= 3500) {
29             System.out.println("不用交个人所得税!");
30         }
31         else if(salary > 3500 && salary <= 5000) {
32             personalIncomeTax = (salary - fiveInsurancePayments - taxThreshold) * tariff1 - 0;
33             System.out.println("个人所得税为:" + personalIncomeTax + "元");
34         }
35         else if(salary > 5000 && salary <= 8000) {
36             personalIncomeTax = (salary - fiveInsurancePayments - taxThreshold) * tariff2 - 105;
37             System.out.println("个人所得税为:" + personalIncomeTax + "元");
38         }
39         else if(salary > 8000 && salary <= 12500) {
40             personalIncomeTax = (salary - fiveInsurancePayments - taxThreshold) * tariff3 - 555;
41             System.out.println("个人所得税为:" + personalIncomeTax + "元");
42         }
43         else if(salary > 12500 && salary <= 38500) {
44             personalIncomeTax = (salary - fiveInsurancePayments - taxThreshold) * tariff4 - 1005;
45             System.out.println("个人所得税为:" + personalIncomeTax + "元");
46         }
47         else if(salary > 38500 && salary <= 58500) {
48             personalIncomeTax = (salary - fiveInsurancePayments - taxThreshold) * tariff5 - 2755;
49             System.out.println("个人所得税为:" + personalIncomeTax + "元");
50         }
51         else if(salary > 58500 && salary <= 83500) {
52             personalIncomeTax = (salary - fiveInsurancePayments - taxThreshold) * tariff6 - 5505;
53             System.out.println("个人所得税为:" + personalIncomeTax + "元");
54         }
55         else if(salary > 83500) {
56             personalIncomeTax = (salary - fiveInsurancePayments - taxThreshold) * tariff7 - 13505;
57             System.out.println("个人所得税为:" + personalIncomeTax + "元");
58         }
59         else {
60             System.out.println("您输入无效!");
61         }
62     }
63 }

 

分类:

技术点:

相关文章: