zoukankan      html  css  js  c++  java
  • java Scanner

    public static void main(String[] args) throws IOException {
    System.out.print("Enter a number:");
    Scanner in = new Scanner(System.in);
    boolean available = in.hasNextInt();
    if(!available){
    System.out.println("......请输入一个数字......");
    }else{
    int x = in.nextInt();
    System.out.println("输入金额:"+x);
    String y = "";
    if(x<=3500){
    y="不需要交税";
    }else if(x > 3500 && x <=5000 ){
    y = "应征税:"+((x-3500)*0.03);
    }else if(x > 5000 && x <= 8000 ){
    y = "应征税:"+((x-5000)*0.1 + 1500*0.03);
    }else if(x > 8000 && x <= 12500 ){
    y = "应征税:"+((x-8000)*0.2 + 3000*0.1 + 1500*0.03);
    }else if(x > 12500 && x <= 15000 ){
    y = "应征税:"+((x-12500)*0.25 + 4500*0.2 + 3000*0.1 + 1500*0.03);
    }else if(x > 15000 ){
    y = "应征税:"+((x-15000)*0.3 + 2500*0.25 + 4500*0.2 + 3000*0.1 + 1500*0.03);
    }
    System.out.println(y);
    }
    }

  • 相关阅读:
    javascript学习6
    javascript学习5
    javascript学习4
    javaccript学习3
    javaccript学习2
    javaccript学习1
    C++ 线性表实现
    深入解析策略模式(转)
    CentOS7安装MySQL
    万能媒体播放器 PotPlayer
  • 原文地址:https://www.cnblogs.com/chenweichu/p/6019528.html
Copyright © 2011-2022 走看看