package edu.oakland.OUSoft.database;

/**
 * includes an array of references to all Students and an array of references to all Instructors,
 * methods to add students and instructors,
 * methods to retrieve student/instructor reference using person’s id,
 * methods to remove student/instructor using either the object reference of person’s id,
 * methods for printing all students or instructors,
 * methods for taking input from command line
 */
public class OUPeople {
}

@@ -31,16 +31,171 @@
 abase;%0A%0A
+import edu.oakland.OUSoft.items.Instructor;%0Aimport edu.oakland.OUSoft.items.Person;%0Aimport edu.oakland.OUSoft.items.Student;%0A%0Aimport java.util.ArrayList;%0A%0A
 /**%0A * i
@@ -620,10 +620,1078 @@
 eople %7B%0A
+%09%0A%09private ArrayList students;%0A%09private ArrayList instructors;%0A%09private ArrayList others;%0A%09%0A%09/**%0A%09 * Retrieve a student using their ID%0A%09 *%0A%09 * @param ID The students ID%0A%09 * @return The student, or null if not found%0A%09 */%0A%09public Student retrieveStudentByID(int ID) %7B%0A%09%09for (Student student : students) %7B%0A%09%09%09if (student.getID() == ID) %7B%0A%09%09%09%09return student;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return null;%0A%09%7D%0A%09%0A%09/**%0A%09 * Retrieve an instructor using their ID%0A%09 *%0A%09 * @param ID The instructors ID%0A%09 * @return The instructor, or null if not found%0A%09 */%0A%09public Student retrieveInstructorByID(int ID) %7B%0A%09%09for (Instructor instructor : instructors) %7B%0A%09%09%09if (instructor.getID() == ID) %7B%0A%09%09%09%09return instructor;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return null;%0A%09%7D%0A%09%0A%09/**%0A%09 * Add a person to the database, automatically determining type%0A%09 *%0A%09 * @param person The Person to add%0A%09 */%0A%09public void add(Person person) %7B%0A%09%09if (person instanceof Student) %7B%0A%09%09%09this.students.add((Student) person);%0A%09%09%7D else if (person instanceof Instructor) %7B%0A%09%09%09this.instructors.add((Instructor) person);%0A%09%09%7D else %7B%0A%09%09%09this.others.add(person);%0A%09%09%7D%0A%09%09%0A%09%7D%0A
 %7D%0A

Implement some of OUPeople