算工资

import javax.swing.JOptionPane;
public class Salary {
    public static void main(String[] args){
        String name = JOptionPane.showInputDialog(null,"请输入姓名:");
        String input = JOptionPane.showInputDialog(null,"请输入每周工作时间:");
        String input1 = JOptionPane.showInputDialog(null,"请输入每小时工资:");
        String input2 = JOptionPane.showInputDialog(null,"请输入联邦所得税税率:");
        String input3 = JOptionPane.showInputDialog(null,"请输入州所得税税率:");
        double hours = Double.parseDouble(input);
        double rate = Double.parseDouble(input1);
        double federal = Double.parseDouble(input2);
        double state = Double.parseDouble(input3);
        System.out.println("Employee Name:" + name);
        System.out.println("Hours Worked:" + hours);
        System.out.println("Pay Rate:" + hours);
        System.out.println("Gross Pay:" + hours * rate);
        System.out.println("Deductions:");
        System.out.println("Federal Withholding:" + hours * rate * federal);
        System.out.println("State Witholding:" + hours * rate * state);
        System.out.println("Total Deduction:" + (hours * rate * federal + hours * rate * state));
        System.out.println("Net Pay:" + (hours * rate - (hours * rate * federal + hours * rate * state)));
    }

}

输入员工姓名,每周工作时间,每小时工资,联邦所得税税率,州所得税税率。输出员工工资单。

员工工资等于每周时间*每小时就工资-联邦交的税-州交的税。

转载于:https://www.cnblogs.com/Amoxicil/p/3894994.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值