PIbd-32_Stroev_V_M_PMD/lib/University.dart
2024-10-01 20:53:17 +04:00

19 lines
391 B
Dart

import 'student.dart';
class University {
List<Student> students = [];
void addStudent(Student student) {
students.add(student);
}
void displayAllStudents() {
for (var student in students) {
student.displayInfo();
}
}
List<Student> getStudentsByCourse(String course) {
return students.where((student) => student.courses.contains(course)).toList();
}
}