月度考试如果机试成绩大于等于90分并且理论成绩大于90分,或者上机成绩和理论成绩的平均分大于等于80分,并且综合积分不低于90分也能考试通关。
要求:
1、在控制台输入学生的机试成绩、理论成绩、综合积分
2、如果考试通关提示“恭喜你考试通关”
public static void main(String[] args) {
int i=0;
for(i=0;i<=100;i++){
System.out.println("请输入机试成绩:");
int jishi = new Scanner(System.in).nextInt();
System.out.println("请输入理论成绩:");
int lilun = new Scanner(System.in).nextInt();
System.out.println("请输入综合积分:");
int zonghe = new Scanner(System.in).nextInt();
boolean condiion1=jishi>=90 && lilun>=90;
boolean condition2=(jishi+lilun)/2<=90 && zonghe>=90;
if(condiion1 || condition2){
System.out.println("恭喜你考试通过");
}else{
System.out.println("考试没通过");
}
}
}