- import java.util.Scanner;
- class Test6_day03 {
- public static void main(String[] args) {
-
- Scanner scan = new Scanner(System.in);
- System.out.println("请输入您的工龄:(0~15)");
- int workAge = scan.nextInt(); //workAge 工龄
- System.out.println("请输入您的基本工资:");
- int baseSalary = scan.nextInt(); //baseSalary基本工资
- int salary = 0; //salary 涨后工资
- int boun = 0; //boun 应涨工资
- if (workAge >= 10 && workAge < 15) {
- boun = 5000;
- }else if (workAge >= 5) {
- boun = 2500;
- }else if (workAge >= 3) {
- boun = 1000;
- }else if (workAge >= 1) {
- boun = 500;
- }else if (workAge >= 0) {
- boun = 200;
- }else {
- System.out.println("您输入的工龄有误,请重新运行!");
- return;
- }
- salary = baseSalary + boun;
- System.out.println("您目前工作了 " + workAge +
- " 年,基本工资为 " + baseSalary +
- " 元, 应涨工资 " + boun + "元,涨后工资 " + salary +" 元");
- }
- }
复制代码
|