import java.util.*; // *** Do you need another import statement here?? *** /** * Lab #4 * CS 2334, Section 0?? * DATE GOES HERE *

* This class implements a program that tests the Movie ADT. *

* @author Group #? * @version 1.0 */ public class Test { /** * This is the main method for this test program. Since this is a * simple test program, all of our code will be in the main method. * Typically this would be a bad design, but we are just testing out * some features of Java. *

* @param args Contains the command line arguments. */ public static void main(String[] args) throws IOException, ClassNotFoundException { List movies = new ArrayList(); /* * 1. Instantiate eight objects of type Movie and add them * to the list movies. * I have created and added the first movie for you. :) */ Movie movie1 = new Movie( "Titanic", 1997 ); Movie movie2 = new Movie( "Star Wars", 1977 ); Movie movie3 = new Movie( "Shrek 2", 2004 ); Movie movie4 = new Movie( "E.T.: The Extra-Terrestrial", 1982 ); Movie movie5 = new Movie( "Star Wars: Episode I - The Phantom Menace", 1999 ); Movie movie6 = new Movie( "Pirates of the Caribbean: Dead Man's Chest ", 2006 ); Movie movie7 = new Movie( "Spider-Man ", 2002 ); Movie movie8 = new Movie( "Star Wars: Episode III - Revenge of the Sith", 2005 ); /* The list is referenced to by the variable movies. You can add to * the list by invoking the add method if ArrayList. */ movies.add( movie1 ); movies.add( movie2 ); movies.add( movie3 ); movies.add( movie4 ); movies.add( movie5 ); movies.add( movie6 ); movies.add( movie7 ); movies.add( movie8 ); /* For Question #6, add code that does the following. * 1. Write out the list of movies to a file. * 2. Erase all the elements in the list of movies. * 3. Print the contents of the list of movies to the console using * System.out.println() and an Iterator. * 4. Read in the list of movies from the file in step #1. * 5. Print the contents of the list of movies to the console using * System.out.println() and an Iterator. */ /* For Question #9, add code that does the following. * 1.Write out the list of movies to a file. * 2.Erase all the elements in the list of movies. * 3.Print the contents of the list of movies to the console using * System.out.println() and an Iterator. * 4.Read in the list of movies from the file in step #1. * 5.Print the contents of the list of movies to the console using * System.out.println() and an Iterator. */ } }