学生成绩等级分类

public class ScoreGrade {
public static void main(String[] args) {
java.util.Scanner s=new java.util.Scanner(System.in);
System.out.println(“请输入学生成绩”);
double score=s.nextDouble();
int achievement =(int)score/10;
switch(achievement){
case 10:
case 9:
System.out.println(“成绩等级为A”);
break;
case 8:
System.out.println(“成绩等级为B”);
break;
case 7:
System.out.println(“成绩等级为C”);
break;
case 6:
System.out.println(“成绩等级为D”);
break;
default :
System.out.println(“成绩等级为E”);
}
}
}

你可能感兴趣的:(笔记,java)