-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathMain.java
More file actions
32 lines (24 loc) · 989 Bytes
/
Main.java
File metadata and controls
32 lines (24 loc) · 989 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
package students.jamesbarclay;
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
// Create students
Student student1 = new Student(1, "Jordan", "Michael", "jordan@gmail.com", '2', 2.3);
Student student2 = new Student(1, "Marcus", "Ross", "marcus@gmail.com", '1', 3.9);
// Create instructor and assign students
Instructor instructor1 = new Instructor(100, "Dr.", "Rivera", "rivera@gmail.com", "Computer Science");
instructor1.addStudent(student1);
instructor1.addStudent(student2);
ArrayList<Person> people = new ArrayList<>();
people.add(student1);
people.add(student2);
people.add(instructor1);
System.out.println("--- People Summaries ---");
for (Person p : people) {
p.getSummary();
}
// Print roster
System.out.println("\n--- Instructor Rosters ---");
instructor1.printRoster();
}
}