异常处理 课后作业

课后作业1

课后作业2动手动脑

package javaClassTest2;

import java.util.Scanner;

public class test
{

public static void main(String[] args)
{
test t=new test();
Scanner cin=new Scanner(System.in);
int score=cin.nextInt();
t.conclusion(score);
}

void conclusion(int socre)
{
if(socre>0&&socre<60) System.out.println("不及格");
else if(socre>0&&socre<70) System.out.println("及格");
else if(socre>0&&socre<80) System.out.println("中");
else if(socre>0&&socre<90) System.out.println("良");
else if(socre>0&&socre<=100) System.out.println("优");
else System.out.println("错误");
}
}

这个是不对的。今天有些困先睡了,明天再说。

原文地址:https://www.cnblogs.com/cc-9878/p/7846804.html