9.依次输入10个学生成绩,判断学生(优秀、良好、中等、及格、不及格)用switch
package test1;
import java.util.Scanner;
public class example9 {
public static void main(String[] args) {
int n=0; // TODO Auto-generated method stub
System.out.println("成绩:");
Scanner sc =new Scanner (System.in);
int stu=sc.nextInt();
if (stu>100) System.out.println("成绩错误");
if (stu<0) System.out.println("成绩错误");
if (stu>90) n=1;
if (stu>80) n=2;
if (stu>70) n=3;
if (stu>60) n=4;
if (stu<60&&stu>0) n=5;
switch(n) {
case 1:System.out.println("优秀");
case 2:System.out.println("良好");
case 3:System.out.println("中等");
case 4:System.out.println("及格");
case 5:System.out.println("不及格");
}
}
}
10.编写一个circle类