Java给出一个分数,按不同的分数段将其评定为A、B、C、D和E五个档次之一
输入
86
输出
评定成绩为:B
package com;
import java.util.*;
public class app4_2 {
public static void main(String[] args)
{
int testScore;
char grade;
Scanner reader=new Scanner(System.in);
System.out.print("请输入要评定的成绩:\n");
testScore=reader.nextInt();
if(testScore>=90)
grade='A';
else if(testScore>=80)
grade='B';
else if(testScore>=70)
grade='C';
else if(testScore>=60)
grade='D';
else grade='E';
System.out.println("评定成绩为:"+grade);
}
}