为什么不打印税款

为什么不打印税款

本文介绍了为什么不打印税款?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

package payroll;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
     Scanner input = new Scanner(System.in);
     String employeename;
     int salary;
     int hourswork;
     int monthhours;
     int monthsalary;
     int tax;
     System.out.println("please enter the employeename:");
     employeename = input.nextLine();
     System.out.printf("welcome to the payroll for %s\n\n",employeename);
        System.out.println("please enter hours work in a day:");
     hourswork = input.nextInt();
     monthhours = 30 * hourswork;
     System.out.printf("%s is work %s hours in a month",employeename,monthhours);
     System.out.printf("\nhow much is %s's salary in an hour in tomans? ",employeename);
     salary = input.nextInt();
     monthsalary = hourswork*salary*30;
     System.out.printf("%s is %s's salary",monthsalary,employeename);
     tax = monthsalary - (monthsalary*(1/10));
     System.out.printf("\n%s's salary with tax is %s ",employeename,tax);

    }
}

推荐答案


这篇关于为什么不打印税款?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-11 18:37