package edu.oakland.production;

import edu.oakland.helper.Student;

public class SIS {

	private Student[] students;
	private int numStudents = 0;

	/**
	 * Create a new SIS with the default capacity of 5 students.
	 */
	public SIS() {
		students = new Student[5];
	}

	/**
	 * Create a new SIS with the specified capacity of students.
	 *
	 * @param maximumStudents The maximum number of students that will be stored.
	 */
	public SIS(int maximumStudents) {
		students = new Student[maximumStudents];
	}

	/**
	 * Add a student to the SIS.
	 *
	 * @param student The {@link Student} to add.
	 */
	public void addStudent(Student student) {
		this.students[numStudents] = student;
		this.numStudents++;
	}

	/**
	 * Retrieve a student from the SIS based on Grizzly ID.
	 *
	 * @param GID The student's Grizzly ID.
	 */
	public Student getStudentByID(int GID) {
		for (Student s : students) {
			if (s == null) {
				continue;
			}
			if (s.getGrizzlyID() == GID) {
				return s;
			}
		}

		return null;
	}
}

@@ -60,16 +60,41 @@
 Student;
+%0Aimport java.util.Arrays;
 %0A%0Apublic
@@ -196,48 +196,8 @@
  SIS
- with the default capacity of 5 students
 .%0A%09 
@@ -244,9 +244,9 @@
 ent%5B
-5
+1
 %5D;%0A%09
@@ -261,64 +261,32 @@
 %09 * 
-Create a new SIS with the specified capacity of students
+Add a student to the SIS
 .%0A%09 
@@ -302,296 +302,227 @@
 ram 
-maximumS
+s
 tudent
-s
  The 
-maximum number of s
+%7B@link S
 tudent
-s that will be stored.%0A%09 */%0A%09public SIS(int maximumStudents) %7B%0A%09%09students = new Student%5BmaximumStudents%5D;%0A%09%7D%0A%0A%09/**%0A%09 * Add a student to the SIS.%0A%09 *%0A%09 * @param student The %7B@link Student%7D to add.%0A%09 */%0A%09public void addStudent(Student student) %7B
+%7D to add.%0A%09 */%0A%09public void addStudent(Student student) %7B%0A%09%09if (this.students.length %3C= this.numStudents) %7B //No space left%0A%09%09%09this.students = Arrays.copyOf(this.students, numStudents + 1);%0A%09%09%7D
 %0A%09%09t

Update SIS to increase array size as students are added