-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathSchool.java
More file actions
36 lines (28 loc) · 896 Bytes
/
School.java
File metadata and controls
36 lines (28 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package students.jordaneldridge.maxxblue;
import java.util.ArrayList;
import java.util.List;
public class School {
private List<Student> students;
private List<Instructor> instructors;
public School() {
this.students = new ArrayList<>();
this.instructors = new ArrayList<>();
}
public void addStudent(Student student) {
students.add(student);
}
public void addInstructor(Instructor instructor) {
instructors.add(instructor);
}
public void printDirectory() {
System.out.println("=== School Directory ===");
System.out.println("Students:");
for (Student s : students) {
System.out.println(" - " + s.getSummary());
}
System.out.println("Instructors:");
for (Instructor i : instructors) {
System.out.println(" - " + i.getSummary());
}
}
}