Skip to content

Conversation

@feruzida
Copy link
Owner

@feruzida feruzida commented Oct 8, 2025

Completed Lesson 05

public class Course {
private String name;
private String teacher;
private ArrayList<Student> student = new ArrayList<>();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

списки всегда именуем во множественном числе

private String name;
private String teacher;
private ArrayList<Student> student = new ArrayList<>();
private ArrayList<Student> attendanceJournal = new ArrayList<>();

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Посещаемость можно реализовать как отдельный журнал где будет указан (id, course_id, student_id, attendance_date, status(enums))
Также можно реализовать и бальную систему через журнал где будет указан (id, course_id, student_id, assignment, point, date)
Курс сам по себе обособленная сущность, которая не должна содержать студентов и посещаемость.

}

public void addStudent(Student s) {
for (Student student1 : student) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Проверка дубликатов это хорошо, и как ее можно улучшить? Чтобы не перебирать весь список, можно использовать Set вместо List или же Map

public void showResults() {
System.out.println("\nQuiz results for " + "\"" + title + "\"");
int maxScore = 0;
for (Team team : teams) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

два одинаковых цикла не хорошо, лучше реализовать всю логику в одном цикле

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Понял, спасибо за комментарии

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants