题解 | 学生综合评估系统

学生综合评估系统

https://www.nowcoder.com/practice/d8d5d6294b8f48b684ea93fbb4935a2b

import java.util.*;

public class Main {
    static class Student {
        int id;
        int academic_score;
        int activity_score;
        
        public Student(int id, int academic, int activity) {
            this.id = id;
            this.academic_score = academic;
            this.activity_score = activity;
        }
    }

    static boolean isExcellent(Student student) {
        if((student.academic_score + student.activity_score > 140) && (student.academic_score * 0.7 + student.activity_score * 0.3 >= 80)){
            return true;
        }else{
            return false;
        }
    }





































































































































































































    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        
        for (int i = 0; i < n; i++) {
            int id = scanner.nextInt();
            int academic = scanner.nextInt();
            int activity = scanner.nextInt();
            Student student = new Student(id, academic, activity);
            
            if (isExcellent(student)) {
                System.out.println("Excellent");
            } else {
                System.out.println("Not excellent");
            }
        }
        scanner.close();
    }
}

全部评论

相关推荐

01-15 13:45
门头沟学院 Java
牛客92772631...:boss招聘挂岗位是要花钱的,花了钱不挂白不挂,别那么焦虑,但是也要做好跳槽的准备
找实习记录
点赞 评论 收藏
分享
01-12 20:31
东北大学 Java
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务