CMSC 202 Project 3

The F & R Memorial Library

Assigned Wed Oct 10
Program Due 10:00AM, Wed Oct 24
Design Due 10:00AM, Wed Oct 17
Weight 8%
Updates 19 Oct 2007
An updated version of Project3.java is available in Mr. Frey's public directory
The original version did not remove leading or trailing space characters from book
titles or first and last names. This could make it appear that some of your Library
methods were working incorrectly when in fact they were correct. E.g. if you entered a
book title of " Lassie " when adding a book, but then entered "Lassie"
when checking out that book, your checkOutBook method may report that the book does not exist.
The new version of Project3.java removes all leading and trailing spaces from all text fields entered.

Objectives


Project Description
This project will simulate a simple library. The library will consist of a set of books and set of patrons (people who borrow and return books). The library keeps each book's title and author. Books are uniquely identified by their title. The library keeps each patron's first and last name and assigns each patron a unique library card number. Patron's are uniquely identified by their name and their card number. Library card numbers start at 1001. Your library will support the following functionality. More details may be found in the Javadoc for the Library.
  1. Add a book to the library
  2. Add a patron to the library
  3. Check out a book to a patron
  4. Return (check in) a book
  5. List all books in the library
  6. List all patrons of the library
  7. Display the information for a particular book
  8. Display the information about a particular patron
This project will use a GUI to allow the user to select the function he wishes to perform. The GUI and the main driver will be provided for you in Project3.java to be found in Mr. Frey's public directory for this project. The GUI provides the required data input error checking. Your job is to design and implement a class for the Library and other necessary classes. Since only the Library class is used directly by main in Project3.java, you are free to design and implement the other classes as you see fit. A significant part of the project grade will rely on how well you design and implement the Library and these other classes.
Project Policy
This project is considered an CLOSED project. This means
  1. You should try as much as possible to complete the project by yourself.
  2. You may get assistance only from the TAs or instructors
  3. You must document all outside help you get as part of your file header comment.
As usual, you MAY NOT
  1. copy anyone else's code
  2. have someone else write your code for you
  3. submit someone else's code as your own
  4. look at someone else's code
  5. have someone else's code in your possession at any time
Such offenses are violations of the student code of academic conduct.
Project Specification

The Library Class

The required Libarary class should have capacity to hold up to 1000 different book titles and up to 50 different patrons. The library class provides public methods to support the functionality listed above in the project description. This Javadoc description lists the public methods and constants that the library must support and provides many details of the Library methods. You are free to write any private helper methods you deem necessary.

Other Classes

It should be clear from the project description that classes are necessary for a book and for a patron. A class that models a name is also required. Think about what "thing" each class represents, what instance variables are needed to represent the "thing's" state, and what operations the "thing" must provide for the Library. Do all of this before writing even one line of code.

You must implement code in main for each class to test that class' functionality.

Requirements, Hints, and Tips


Extra Credit
For 10 points of extra credit, your library should allow for multiple copies of the same book title (e.g. MAX_COPIES = 5). Each copy may be checked out to a different patron. A patron may check out multiple copies of the same book. The String returned from the library operations "display information about a book", "check out a book", and "return a book" should indicate the number of copies, how many are checked out (and to whom) and how many are available for check out. The "list of all books" should include the number of copies of each book. pwd

Note that even if multiple copies of a book are added to the library, the number of book titles in the library is still incremented by one. The library holds 1000 different book titles, even if each book has multiple copies.


Grading

The grade for this project will be broken down as follows. A more detailed breakdown will be provided in the grade form you receive with your project grade.

10% - Project Design
Copy p3design.txt from Mr. Frey's public directory and edit the file to answer the questions. Be sure to submit this file by its due date.
80% - Correctness
This list may not be comprehensive, but everything on this list will be verified by the graders.
10% - Coding Standards
Your code adheres to the CMSC 202 coding standards as discussed and reviewed in class.
In particular, pay particular attention to the list below. Graders will check all applicable items in the coding standards.
  1. Your class comments (particularly class invariant)
  2. Your method header comments (particularly pre- and post-conditions)
  3. Method and variable names
  4. In-line comments
  5. Code readability
  6. Limiting variable scope
  7. Class method names
  8. Class instance variable names

Project Submission
  1. submitLibrary.java, p3design.txt and your other .java files.
  2. submitls to verify they are in the remote directory
  3. DO NOT submit Project3.java
The order in which the files are listed doesn't matter. However, you must make sure that all files necessary to compile and run your project are submitted. You need not submit all files at the same time. You may resubmit your files as often as you like, but only the last submittal will be graded and will be used to determine if your project is late. For more information, see the projects page on the course website.

You can check to see what files you have submitted by typing

submitls cs202 Proj3 More complete documentation for submit and related commands can be found here.

Remember -- if you make any change to your program, no matter how insignificant it may seem, you should recompile and retest your program before submitting it. Even the smallest typo can cause compiler errors and a reduction in your grade.

Avoid unpleasant surprises!