package youliang;
import javax.swing.*;
public class DengJi {
public static void main(String args[]){
String s=new String();
int fen,n=0;
while(n==0)
{
try{
s=JOptionPane.showInputDialog("请输入分数:");
fen=Integer.parseInt(s);
if(fen>0&&fen<60)
{JOptionPane.showMessageDialog(null, "不及格!");n=1;}
if(fen>60&&fen<=70)
{JOptionPane.showMessageDialog(null, "及格!");n=1;}
if(fen>70&&fen<80)
{JOptionPane.showMessageDialog(null, "中!");n=1;}
if(fen>80&&fen<90)
{JOptionPane.showMessageDialog(null, "良!");n=1;}
if(fen>90&&fen<=100)
{JOptionPane.showMessageDialog(null, "优!");n=1;}
if(fen<0||fen>100)
{JOptionPane.showMessageDialog(null, "请按要求输入分数!");}

}
catch(Exception e)
{
JOptionPane.showMessageDialog(null, "输入错误,请重新输入:");
}
finally
{
System.out.println("执行finally!");
}
}
}
}

课后题

课后题

 

 

 

课后题

课后题

 

相关文章:

  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-23
  • 2021-05-22
  • 2021-09-28
  • 2021-09-25
  • 2021-08-14
相关资源
相似解决方案