public class HelloWorld {
public static String scoreLevel(int score){
if(score >= 90){
return "优";
}else if(score >= 80){
return "良";
}else if(score >= 70){
return "中";
}else if(score >= 60){
return "及格";
}else{
return "不及格";
}
}
public static void main(String[] args) {
int javaScore = 90;
int dataScore = 70;
int englishScore = 60;
int avrScore=(javaScore+dataScore+englishScore)/3;
System.out.println("Java成绩:"+javaScore+scoreLevel(javaScore));
System.out.println("数据库成绩:"+dataScore+scoreLevel(dataScore));
System.out.println("英语成绩:"+englishScore+scoreLevel(englishScore));
System.out.println("平均成绩:"+avrScore);
}
}