This commit is contained in:
2026-05-26 09:16:20 +03:30
parent 83746b88f6
commit 392499a739
11 changed files with 108 additions and 78 deletions
+11 -20
View File
@@ -11,34 +11,25 @@ public class StudentManager {
public void addStudents(ArrayList<Student> newStudents) {
// TODO:
// Merge students
// Hint:
// addAll()
students.addAll(newStudents);
}
public Student searchStudent(int id) {
// TODO:
// Loop through students
// Compare IDs
for (Student student : students) {
if (student.getId() == id) {
return student;
}
}
return null;
}
public boolean removeStudent(int id) {
// TODO:
// Find student
// Remove student
for (Student student : students) {
if (student.getId() == id) {
students.remove(student);
}
}
return false;
}