import java.util.Scanner;

public class MyListProgram {
  public static void main(String[] args) {
    MyList list = new MyList();
    Scanner scan = new Scanner(System.in);

    System.out.println("Enter a bunch of numbers, type -1 to quit:");
    
    System.out.print("-> ");
    int data = scan.nextInt();
    while(data != -1) {
      // Add it
      boolean success = list.add(data);
      if(success == false) {
	System.out.println("Oops, the array is full");
	break;
      }
      // Read the next line
      System.out.print("-> ");
      data = scan.nextInt();
    }

    // Now print out the contents of the array.
    System.out.println(list.getContents());
  }
}
