Assignment 3 (100 Pts)

Due: Thursday, June 29

In this assignment, we're going to extend Assignment 2 with the concepts we just learned--collections and streams.

Using Collections

We discussed several different types of collections in class on 06/22/06. Instead of an array, choose an appropriate collection to store your media items. Before making your choice, consider how easily you can implement the same functionality as in the last assignment, e.g., easily you can store items, retrieve items, and sort items.

This part is purposedly open-ended. In your README, you will defend your choice of collection.

Using Streams

You will read from a file to initialize the data on program startup. Before a user exits the program, you will write out a file containing the current state of the library.

Note the format of the file. The comments are useful for understanding the format of the file. You will have to be able to handle its format and duplicate the format in the file you write out.

(Rhetorical question: where should you implement the stream functionality? The class files? The driver program? Both?)

A driver program

Again, your driver program emulates a library that keeps track of all the media that is in the library. Your driver program will

When you execute your program, demonstrate your program's ability to handle strange or incorrect behavior as well.

Packages

Similarly to the last assignment, the prefix to your Java class's package for all assignments will be your last name followed by the assignment name. The new package will mean that you're making a copy of your media items from the last assignment into a new package.

Java Docs

Generate and submit Java Docs for all of your classes, including your driver program.

README

Your README file should contain

Script file

Create a script file showing your README, your code, compilation, and execution of your program.

If you use Eclipse to run your program, you can copy the text in the Console window from your program's execution and pastes it into Notepad, or some other form that you can save and print. Or, you can upload (ftp) your code to strauss and use the script command there. Eclipse is just a development environment. Java is portable, so you should be able to run your code on any machine that has a JVM.

Submission

Submit a printed version of your assignment (script file) at the beginning of class on Thursday, June 29.

Electronic Submission Organization

Your submission directory will look something like this:

Email a gzipped tar file of your assignment directory (named lastname, as shown above), which includes the script file, the Java files, the class files, the docs, and README to Ke (kli at cis.udel.edu) before next Thursday (June 29) at 11:59:59 p.m. The name of your zipped submission should be lastname-assign3.tar.gz (or .zip or whatever the appropriate extension). The subject line should be "[Your Name] CISC370: Assignment 3 Submission".

Please do not submit your code from earlier assignments. You may need to create a temporary location that contains your submission so that you do not submit code from earlier assignments.

If you have any questions about submission, ask early!

We will follow similar directory structures in future submissions.

Grading (100 pts)


This problem is based on a similar example from Objects First With Java by David Barnes and Michael Kolling.