Computer Science 122
Assignment 5
Due: October 14, 2003

This assignment is to modify the program you wrote for assignment 2.  For that assignment, you read in data from a file and stored it in an array of objects.  Then you displayed the contents of the array on the screen.

This time you should add a new product to your list.  Add a method to your data class that prompts for and then reads in data from the keyboard.  Then in the class that manages the array, include a method that first checks to see if there is room in the array for an additional product.  If not, display an error message.  If so, get a new instance of the product class, read in the data for it and then add it to the next place in the array.  Do not forget to increase listSize.  It should always indicate the true number of objects in the array.  Call the method that adds the new product from your main class.  Display the contents of the list both before and after adding the new product.

This is a console application and does not use a frame.  So all the reading is from the keyboard and the display is on the console screen.  In the future we will do all this with several windows, but for now, all input should come from the keyboard.

Use a package to contain all the class files for your program.  Put each class into a separate file with the package name at the top.  When the file is compiled, the class files will be stored in a sub-folder that has the same name as the package.  Hand in printouts of each of the files and a disk with the code.

Write meaningful comments for each class and method and use identifiers when naming objects that appropriately describe what the object is or does.