年薪计算器

package com.company;

import java.util.Scanner;

public class text {
    public static void main(String[] args) {
        while (true) {
            Scanner scanner = new Scanner(System.in);
            System.out.println("请输入您的月薪:");
            int monthIn =  scanner.nextInt();
            System.out.println("请输入您工作的月数:");
            int months = scanner.nextInt();
            long yearIn = monthIn * months;
            System.out.println("您的年薪为:" + yearIn);
            if (yearIn > 200000) {
                System.out.println("恭喜你超越98%的国人");
            } else if(yearIn > 100000) {
                System.out.println("恭喜你超越90%的国人");
            } else {
                System.out.println("你还需继续努力");
            }
            scanner.nextLine();
            System.out.println("COMMOND: (next, exit)");
            String commondL = scanner.nextLine();
            if (commondL.equals("exit")) {
                System.out.println("期待您的下次使用!");
                break;
            }
            System.out.println("---------------");
        }
        }}


posted @ 2020-04-29 11:20  jacksonni  阅读(433)  评论(0编辑  收藏  举报