根据成绩英文简写来输出对应等级的成绩
package AotomanPkMaster;
import java.util.Scanner;
public class kaoshi {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("* * * * * *欢迎使用学员状态转换器* * * * * *");
while (true) {
System.out.print("请输入学员状况的第一个英文字母:");
String a = input.next();
char[] grade = a.toCharArray();
if (grade[0] == 'E') {
System.out.println("优秀");
} else if (grade[0] == 'G') {
System.out.println("良好");
} else if (grade[0] == 'S') {
System.out.println("中等");
} else if (grade[0] == 'F') {
System.out.println("不合格");
} else {
System.out.println("输入错误,无法转换!");
}
System.out.println();
System.out.print("你想继续吗?(y/n)");
String b = input.next();
System.out.println();
char[] result = b.toCharArray();
if (result[0] == 'y') {
continue;
} else {
System.out.println("退出系统!");
break;
}
}
}
}