/*************************************************************
* StudentList2Driver.java
* Dean & Dean
*
* This drives StudentList2 class.
*************************************************************/

import java.util.*;

class StudentList2Driver {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);

        String[] names = {"Caleb", "Izumi", "Mary", "Usha"};
        StudentList2 studentList = new StudentList2(names);

        int index;
        boolean reenter;

        studentList.display();
        do {
            System.out.print("Enter index of student to remove: ");
            index = scanner.nextInt();
            try {
                System.out.println("removed " 
                             + studentList.removeStudent(index));
                reenter = false;
            }
            catch (IndexOutOfBoundsException e) {
                System.out.print("Invalid entry. ");
                reenter = true;
            }
        } while (reenter);

        studentList.display();
    } 

} 


