-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathInstructor.java
More file actions
46 lines (35 loc) · 1.16 KB
/
Instructor.java
File metadata and controls
46 lines (35 loc) · 1.16 KB
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
37
38
39
40
41
42
43
44
45
46
package students.mesheikbrown;
import java.util.ArrayList;
public class Instructor extends Person{
private String department;
private ArrayList<Student> students;
public Instructor(int id,String firstName,String lastName,String email,String department) {
super(id,firstName,lastName,email);
this.department = department;
this.students = new ArrayList<>();
}
public String getDepartment() {
return department;
}
public void addStudent(Student student){
students.add(student);
}
public void removeStudent(Student student){
students.remove(student);
}
public void displayRoster() {
System.out.println("[Instructor] Dr." + super.getfirstName() + "'s Roster:");
for(Student student : students) {
student.getSummary();
}
System.out.println("");
}
//returns whatever value is stored in method
public void createAnnouncement(String message){
System.out.println(message);
}
@Override
public void getSummary(){
System.out.println("[Instructor] Dr. " + super.getfirstName() + " | " + "Department: " + getDepartment());
}
}