用Java写题目描述 某工资管理信息系统,工资项目包括编号,姓名,基本工资,绩效工资,津贴工资,保险,税金,实发工资。 税金=(基本工资+绩效工资+津贴工资)x 5% 实发工资=基本工资+绩效工资+津贴工资-保险-税金。 输入 输入一个正整数n,再输入n个职工的前六项信息 输出 计算并输出实发工资(取整)。 样例输入 复制 1 100 mario 50 30 20 5 样例输出 复制 100 mario 90
时间: 2024-03-14 11:48:30 浏览: 218
好的,这是一道简单的Java编程题目,以下是示例代码,供您参考:
```java
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
for (int i = 0; i < n; i++) {
int no = scanner.nextInt();
String name = scanner.next();
int basicSalary = scanner.nextInt();
int performanceSalary = scanner.nextInt();
int allowanceSalary = scanner.nextInt();
int insurance = scanner.nextInt();
int tax = (int) Math.round((basicSalary + performanceSalary + allowanceSalary) * 0.05);
int salary = basicSalary + performanceSalary + allowanceSalary - insurance - tax;
System.out.println(no + " " + name + " " + salary);
}
}
}
```
输入样例:
```
1
100 mario 50 30 20 5
```
输出样例:
```
100 mario 90
```
阅读全文