zoukankan      html  css  js  c++  java
  • 及格问题

    package demo;
    import javax.swing.JOptionPane;
    
    class NotNumber extends Exception{
    }
    public class Credit {
        public static void main(String[] args){
            int cre = 0;
            String c;
            try{
            c=JOptionPane.showInputDialog("请输入成绩:");
            cre = Integer.parseInt(c);
            }
            catch(Exception e){    
                cre = 200;
            }
            if(cre<60)
            {
                JOptionPane.showMessageDialog(null,"不及格", "result",JOptionPane.INFORMATION_MESSAGE);
            }
            else if(cre<70){
                JOptionPane.showMessageDialog(null,"及格", "result",JOptionPane.INFORMATION_MESSAGE);
            }
            else if(cre<80){
                JOptionPane.showMessageDialog(null,"中", "result",JOptionPane.INFORMATION_MESSAGE);
            }
            else if(cre<90){
                JOptionPane.showMessageDialog(null,"良", "result",JOptionPane.INFORMATION_MESSAGE);
            }
            else if(cre<=100){
                JOptionPane.showMessageDialog(null,"优", "result",JOptionPane.INFORMATION_MESSAGE);
            }
            else if(cre==200){
                JOptionPane.showMessageDialog(null,"输入数据有误,请重新输入", "worning",JOptionPane.INFORMATION_MESSAGE);
            }
        }
        
    }
  • 相关阅读:
    Linux ps命令
    SecureCRT注册机使用方法
    微信消息的处理和应答
    微信公众号开发--开发服务器接入微信服务器
    RESTful架构
    OAuth2.0详解
    HTTP头详解
    Cookie/Session机制详解
    学习tornado:安全
    python tornado框架实现CRUD
  • 原文地址:https://www.cnblogs.com/19950216z/p/4975729.html
Copyright © 2011-2022 走看看