ICS 52: Introduction to Software Engineering

Fall, 2008
Homework A: Making modifications to the Lib system
Due: Friday, October 10 at midnight (end of the day) (turned in electronically)

For this assignment you will make several programming modifications to a small Java system called Lib. The source code files for Lib are in LibFiles.zip Also in this zip file is a data file, Titles.dat, which is plain ascii text.

To make the modifications required, you will first have to compile and run the system, and then become familiar with the source code. (Use java Lib optionally followed by Titles.dat to run the compiled code.) There may be several Java features used in Lib with which you are not familiar, so start early, and do not hesitate to read Java books, talk with fellow students about Java programming questions, ask questions in discussion session, and post (and answer!) questions on the ICS 52 NoteBoard.

Your assignment

Your assignment is to make the following enhancements to the current Lib system:
  1. The current system compiles under Java 1.6, but creates several warning messages. Compile the code using -Xlint options, and modify the code (minimally) so that it compiles without warnings. You may find http://java.sun.com/javase/6/docs/api/ helpful.
  2. Only one of the four book searches is implemented, namely by ISBN. Add code to LibFrame (and perhaps elsewhere) to fully implement searching by Title, Author, and Key Word. Make sure you use the Iterations provided by the BookCollection class. This part of the assignment primarily involves completing the user interface. After the book(s) are found, the user should be able to select one and check it out. Books are always checked out by the currently selected user.
  3. The ISBN search, which is implemented, requires an exact match of ISBN. Make this function more flexible by ignoring dashes in the ISBN. For instance, if the user types in "0-1234567-8", this should match the ISBN "012345678" and the ISBN "0-123-4567-8".
  4. As the system currently stands, you can quit the application without saving your data. Implement a feature that is standard in most office and productivity applications: if the user exits and there are unsaved changes, prompt the user to save those changes.
  5. Add functionality to permit books that have been checked out to be checked back in to the library. (Some of the methods you will need are already present; use them.)
  6. Add functionality to permit a user to reserve a book. Only a book that is currently checked out by another user can be put on reserve. At most one user can have a given book on reserve. When a book is checked in, if it has been reserved by another card holder then that card holder automatically checks it out.

In addition to coding the enhancements listed above, you will write a brief report describing the status of your homework. This report should be a file called Report.doc, Report.txt, or Report.pdf. In your report, describe what parts of the homework have been completed and what (if any) have not. If there are any known bugs in your code, identify them. Also, specify the name of a file holding serialized data that we can load with File Open.

Completely implementing all these features in the required time frame will be challenging. Make sure you budget your time wisely and start early. Your score will be much higher if you completely implement a few items, instead of partially implementing many items. In general, you won't get any points for code that doesn't run at least somewhat. We will use approximately the following schedule for awarding points: 10 points for the report; 5 points for fixing the warnings, 25 points for additional searches; 15 points for each of the other four areas of functionality.

Turning in the deliverable

The project will be turned in through checkmate. You will turn in:

  1. A zip file called hwA.zip containing all the .java files (including any that you did not modify), Titles.dat (probably unmodified), and a file with the extension .ser that was created with your program's Save function.
  2. The report, named Report.doc, Report.txt, or Report.pdf.

To evaluate your implementation, we will log onto an ICS lab Windows computer, open a command prompt window, cd to a folder containing your files, decompress hwA.zip, and enter

javac *.java
java Lib
It is strongly recommended that you test your system using this same technique. Projects that work "on your machine" or "only with Eclipse" or "only if you enter something special on the command line" will not receive full credit.

You will not turn in any paper for this assignment.