(if语句)中国的个税计算方法

package com.study.demo;

import java.util.Scanner;

public class Demo8 {
    public static void main(String [] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入一个整数,表示税前收入:");
        
        int wages = input.nextInt();// 税前工资
        //    应缴款项 = (税前工资 - 各类保险 - 3500 )*税率 - 速算扣除数;
        //    实发工资 = 税前工资 - 应缴款项 - 各类保险
        
         if( wages < 1500 ) {
             System.out.println("应缴税款:262\n,税费档次太低不用缴纳");
         }else if( wages <= 3500 && wages >= 1500 ) {
             System.out.println(
                     "各类保险:262\n" + 
                     "\n税后工资:" + (wages - 262)
             );
         }else if( wages <= 4500 && wages >= 3501) {
             double sleep = (wages - 262 - 3500) * 0.03;//税款
             System.out.println(
                     "各类保险:262\n" + 
                     "税率收税:" + sleep +
                     "\n税后工资:" + (wages - sleep - 262)
             );
         }else if( wages <= 9000 && wages >= 4501) {
             double sleep = (wages - 262 - 3500) * 0.1 - 105;//税款
             System.out.println(
                     "各类保险:262\n" + 
                     "税率收税:" + sleep +
                     "\n税后工资:" + (wages - sleep - 262)
             );
         }else if( wages <= 35000 && wages >= 9001 ) {
             double sleep = (wages - 262 - 3500) * 0.2 - 555;//税款
             System.out.println(
                     "各类保险:262\n" + 
                     "税率收税:" + sleep +
                     "\n税后工资:" + (wages - sleep - 262)
             );
         }else if( wages <= 55000 && wages >= 35001 ) {
             double sleep = (wages - 262 - 3500) * 0.25 - 1005;//税款
             System.out.println(
                     "各类保险:262\n" + 
                     "税率收税:" + sleep +
                     "\n税后工资:" + (wages - sleep - 262)
             );
         }else if( wages <= 80000 && wages >= 55001 ) {
             double sleep = (wages - 262 - 3500) * 0.3 - 2755;//税款
             System.out.println(
                     "各类保险:262\n" + 
                     "税率收税:" + sleep +
                     "\n税后工资:" + (wages - sleep - 262)
             );
         }else if( wages<=115000 && wages >= 80001 ) {
             double sleep = (wages - 262 - 3500) * 0.35 - 5505;//税款
             System.out.println(
                     "各类保险:262\n" + 
                     "税率收税:" + sleep +
                     "\n税后工资:" + (wages - sleep - 262)
             );
         }else if( wages >= 115001 ){
             double sleep = (wages - 262 - 3500) * 0.45 - 13505;//税款
             System.out.println(
                     "各类保险:262\n" + 
                     "税率收税:" + sleep +
                     "\n税后工资:" + (wages - sleep - 262)
             );
         }
    }
}

 

上一篇:【leetCode周赛】【美团第 262 场周赛】:leetCode:2032. 至少在两个数组中出现的值


下一篇:LeetCode第262场周赛题解