-
Notifications
You must be signed in to change notification settings - Fork 0
Lesson 05 #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| public class Course { | ||
| private String name; | ||
| private String teacher; | ||
| private ArrayList<Student> student = new ArrayList<>(); |
There was a problem hiding this comment.
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<>(); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
два одинаковых цикла не хорошо, лучше реализовать всю логику в одном цикле
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Понял, спасибо за комментарии
Completed Lesson 05