zoukankan      html  css  js  c++  java
  • 个人所得税,学生成绩的代码

    import java.util.Scanner;
    class Demo{
        public static void main(String [] args){
            Scanner s=new  Scanner(System.in);
            System.out.println("请输入收入金额");
            double income=s.nextInt();
            double money;
            double tex=0;
            if (income<=3500)
            {
                money=income;
            }
            else if((income-3500)<=500)
            {
                tex =(income-3500)*0.05;
            }
            else if((income-3500)<=2000)
            {
                tex =(income-3500-500)*0.1+25;
            }
            else if((income-3500)<=5000)
            {
                tex =(income-3500-2000)*0.15+125;
            }
            else if((income-3500)<=20000)
            {
                tex =(income-3500-5000)*0.2+375;
            }
            else if((income-3500)<=40000)
            {
                tex =(income-20000-3500)*0.25+1375;
            }
            else if((income-3500)<=60000)
            {
                tex =(income-3500-40000)*0.3+3375;
            }
            else if((income-3500)<=80000)
            {
                tex =(income-3500-60000)*0.35+6375;
            }
            else if((income-3500)<=100000)
            {
                tex =(income-3500-80000)*0.4+10375;
            }
            else if((income-3500)>100000)
            {
                tex =(income-3500-100000)*0.45+15375;
            }
            money=income-tex;
            System.out.println("最后得到的工资为:"+money+"个人应缴纳的税为:"+tex);
        }
    }

    学生成绩

    import java.util.Scanner;
    class Demo
    {
        public static void main(String[] args){
            Scanner s=new Scanner(System.in);
            System.out.println("请输入一个学生的成绩");
            int score=s.nextInt();
            if(90<=score&&score<=100)
            {
                System.out.println("优秀");
            }
            else if(70<=score&&score<=80)
            {
                System.out.println("良好");
            }
            else if(60<=score&&score<=70)
            {
                System.out.println("及格");
            }
            else if(score<=60&&score>=0)
            {
                System.out.println("不及格");
            }
            else{
                System.out.println("输入错误");
                }
        }

  • 相关阅读:
    Swift技术之如何在iOS 8下使用Swift设计一个自定义的输入法 (主要是NSLayoutConstraint 的使用)
    android 旋转手机的时候,如何忽略onCreate再次被系统调用?
    在iOS 8中使用UIAlertController
    09_android入门_采用android-async-http开源项目的GET方式或POST方式实现登陆案例
    一些工具的版本问题 valgrind gdb 以及编译
    C struct __attribute__ ((__packed__))
    C++ class 只允许堆创建/只允许栈创建
    Shell 字符串操作
    存储系统的分类
    ssh 到服务器然后输入中文保存到本地变成乱码
  • 原文地址:https://www.cnblogs.com/wanghuaying/p/9296620.html
Copyright © 2011-2022 走看看