java E201_02_01个人所得税 计算器

本博客介绍了一个使用Java实现的个人所得税计算器程序。该程序通过输入工资数,根据中国个税计算规则,计算出应纳税所得额、个税额及应到手工资。适用于初学者理解和实践Java的选择结构。

 

package 第二章选择结构;
import java.util.Scanner;
public class E201_02_08个税计算器 {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        System.out.printf("请输入工资数:");
        double wages =scan.nextFloat();//工资
        double taxableIncome ;//应纳税所得额
        double taxAmount;//个税额
        double other;//超出的部分
        taxableIncome = wages-4200;//应纳税所得额 = (应发工资wages-四金700)-3500
        //个税额 = 应纳税所得额 *税率-速算扣除数

        if (taxableIncome<=1500) taxAmount = taxableIncome*0.03-0;
        else if ( taxableIncome>1500 && taxableIncome<=4500 ) taxAmount = (taxableIncome)*0.1-105;
        else if ( taxableIncome>4500 && taxableIncome<=9000 ) taxAmount = (taxableIncome)*0.2-555;
        else if ( taxableIncome>9000 && taxableIncome<=35000 ) taxAmount = (taxableIncome)*0.25-1005;
        else if ( taxableIncome>35000 && taxableIncome<=55000 ) taxAmount = (taxableIncome)*0.3-2755;
        else if ( taxableIncome>55000 && taxableIncome<=80000 ) taxAmount = (taxableIncome)*0.35-5505;
        else
            taxAmount = (taxableIncome)*0.45%-13505;

        System.out.printf("个税额:%f\n",taxAmount);
        System.out.printf("应到工资:%f",wages-taxAmount-700);
    }
}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值