Homework 6, A small library.

Short Description:

Write a program that maintains information about books and readers in a small library.

This assignment is worth 40 points.

Goals

When you finish this homework, you should have:

Formal Description

You have been hired to write a simple database for a small library. This library has a collection of books and a set of readers. Readers are identified by their full name and books are identified by their title. The library wishes to track the who is borrowing the books and how often the books are being read. In addition, the library wishes to know how many books and pages each reader has read.

The library holds no more than 1000 books, and has no more than 50 readers. Your program should ensure that these conditions are enforced.

A book consists of the following:

At any time the library might wish to know this information as well as if the book is present in the library, who has the book if it is checked out, and the number of times the book has been read, not counting the current reader if there is one.

A reader consists of a name. At any time the library might wish to know the if the reader has a book, and if so, what book, as well as the number of books and pages the reader has read excluding the current book.

The library wishes to allow the following actions

CHECKOUT: this will allow a reader to check out the given title from the library as long as the title exists, the reader exists, the book is present and the reader does not currently have a book.

Note the statistics on the reader and the book do not change when the book is checked out.

RETURN: this will allow a reader to return a book. This will remove the book from the reader and place it back in the library. The stats for both the reader and the library should be updated at this point.

REPORT: produce a report on the reader.

STATS: print the statistics for a book.

PRINT: this will print the list of all books or readers depending on the argument.

The program should work as follows:

Sample Data Files

Notes

Other Requirements

Required Files

A single tar file containing the source code and makefile for this program. Your tar file should not contain executable code (hw6) or any object files (*.o).

To create tar file, follow the Working with the Tape Archive Utility (tar)

Submission

Submit your tar file to the D2L assignment folder Homework 6 by the due date.