CISC 181 Project 3

The Library's Assistant

The board of the local library has decided that computers are indeed not "just a fad", and have agreed to computerize their operations. The goal is to have all books and library cards online, and to keep track of what books are out, etc. You've been hired to design software to manage the library, its books, and its users. This project is designed to give you experience with making and using classes.

1. Program Design Requirements

To design the software, you need to think about several objects, their attributes, and what actions they can do. There are three classes (objects) in this program. book, library card, and library. Partial specifications for each of these classes are given below. Suggestions: There are to be no friends in this program (Exception: you may implement operator<< for classes Book and Card). Think carefully before you write a lot of code! Think about the objects, their attributes and actions, and their public interface.

2. Main function Listing

Here is a listing of the main program - proper design generally leads to tiny mains. Studying this code will likely give you hints about how the Library object generally works.
// File: proj3.cc
//       main function for library app
#include <iostream.h>
#include <fstream.h>
#include "library.h"

int main() 
{
   Library theLibrary( "cards.dat", "books.dat" );
   char Command;
   bool do_exit = false;
   
   do 
   {
      cout <<theLibrary.showMenu();
      cin >>command;
      do_exit = theLibrary.DoCommand( Command );
   } while ( do_exit == false );
  
   return 0;
}

Things you must do:

  1. Your library class should be able to show all library cards, show all library books, check in a book, check out a book. There should also be a menu option for exiting the program.
  2. Enhance the library so that new cards and books can be created. You'll have to add a couple of librarian functions, and create the user menu.
  3. The library should initialize itself from 2 files (one for library card data, 1 for book data) on startup, and save these config files on shutdown. (Big hint: after you overload the istream + ostream operators for Card and Book, this shouldn't be a lot of code to write. If you didn't overload these, it would be). Ultimately, how you do this is up to you. This is a large part of the project.

    Grading:


    What to hand in:


    Other Important Information: