Posted: | Sunday 10/20/02 |
Design Document Due: | before midnight, Sunday 10/27/02 |
Project Due: | Before midnight, Sunday 11/3/02 |
Notes |
26 Oct 2002
The sample command file contained the command PATRONBOOKS, whereas the project description lists the command as PATRONSBOOKS. As always, the project description is correct. The sample command file has been changed. 24 Oct 2002 Note that is NOT a requirement that function parameters all be pointers. You may choose whether function parameters are pointers or not. An additional error check has been added. (See the requirements section. 23 Oct 2002 In response to student questions...
|
The use of dynamic memory allocation is a fundamental programming technique. Pointers are the only mechanism available to reference memory that is dynamically allocated. The use of dynamic memory, while an essential technique, has potential problems. This project is designed so that you gain experience with these potential problems --
The book class must provide public methods to support the following operations
The Patron class provides no special operations.
An overloaded insertion operator may be provided.
If either of the above errors occurs, send a message to the user
(via cerr) and exit the program.
If any of these errors occur, send a message to the user (via cerr)
and continue your program.
No sample output is being provided. You may format your
output in any neat, easy to read format you feel is appropriate
as long as the required information listed below is present.
Your program must handle all situations in which there is nothing
to print (i.e. no books or no patrons)
See the
CMSC 202 syllabus for links to more information on make files.
The Book Class
The book class contains the title and author of the book. A book is uniquely
identified by its title.
An overloaded insertion operator may be provided.
The Patron Class
The Patron class contains the name of the patron.
Other Requirements and Restrictions
In addition to the coding standards,
your project must adhere to the following requirements
Exceptions: const variables,
static data members and for loop indices declared in the for loop structure
(i.e. for (int i = 0;.....)
is okay).
We will learn better error handling techniques later in the semester.
filename
is the name of the command file described below.
Assumptions
You may assume the following:
The Command File
The command file contains command words and data for each command where
appropriate. To minimize the amount of work necessary for parsing the
command file, each command word and data item will be on a separate line.
Blank lines may occur anywhere within the file and should be ignored.
The command file contains the following command words and data items.
All command words will be in UPPERCASE.
data: book's title, book's author
data: patron's name
no data
data: book's title, patron's name
data: book's title
data: patron's name
no data
Sample Output
There are three required outputs from this program
1. List of all books
This output must include the following information for each book
2. List of Books for a Patron
This output must include the following information
3. List of Patrons
This output is a neatly organized list of patron names.
Project Make File
You are required to submit a make file with this project. The grader should
simply need to type "make Proj3" and your project should compile and link to an
executable called Proj3. The grader should also have the ability to do a
"make clean" and "make cleanest."
Grading
10 Points Extra Credit
For 10 points of extra credit (all or none), do all of the following
WARNING -- Work on the extra credit only
after you have submitted a working project that meets all required specifications.
Project Submission
You must use separate compilation for this project. You should submit
the following files:
Submit as follows: