Assignment 7: Cataloging and Searching
Due: 11/20 at 11:59 p.m.
You work at a library as a librarian and want to create an online catalog
for all books in the library for easy searching. You will create the
catalog with a linked list using the STD library. In order to leverage the efficient insertion that linked lists offer (O(1) (constant time) insertion in the front, middle, or back of the list), your program will maintain the linked list in sorted order.
You will also use a linked list to store the names of authors of each
As programmers we must be capable of developing new algorithms and data structures, however in the real world our languages frequently provide us with the basic containers. In this assignment you will be writing an alternate version of individual assignment
6, using the std::list container to store a simple database.
To get you started I have written up a quick example using a standard list with a struct
What you must implement:
book - class or struct (your choice) in its own file(s), storing:
library - A class that contains a standard linked list of
books. You must supply the same minimal functionality from individual assignment
6 with the following differences:
- Title - (string) May include spaces.
- Author Names - (linked list) A list of author names. Each name
(string) may include spaces.
- Pages - (int) The total number of pages.
- ISBN - (string) Include 13 digits.
- Price (float)
- Year (int or short)
methods are not required.
- The input file format will obviously be different, however should be specified by you and should include the information above as listed (make sure your program can read and write your own file format). (Be sure to preserve proper type information.)
- insert_sorted should sort by the book's title.
- lookup and reverse_lookup should be replaced with
find_book (which prints all of the
books with the searched string as a substring of the title) and
author_search (which prints information on all
books by a given author).
- delete_employee should be replaced with a generic remove(string) method that takes the
book title, author name, or ISBN as a parameter and removes them from the database.
- all method/variable names should be otherwise renamed as appropriate for
a book library.
Please make sure to follow all documentation/whitespace/file standards that have been outlined in class so far. Additionally, you should not use any additional C++ libraries for this project except for iostream, iomanip, fstream, list, and string.
Consider the user interaction of your program. Try to construct an intuitive user interface in the form of a command-line, menu-driven system. Also, try to format the output of your program in an attractive and readable manner.
What you must turn in.
Electronically a single zip file, with the name LASTNAME_FIRSTNAME.zip, containing:
- your source code separated into (at minimum) a main.cpp, a .h/.cpp for your library class
- a working makefile
- an example database file that your program can read from (and could have written) containing at least 5
books that demonstrates your project's functionality
- any additional classes/structs should have their own files.
- a valid makefile separated into object and executable rules, with a clean target specified
- Just like before your program should write to a database that is readable by your software.
- a README clearly indicating what have been achieved and what have not
and any lessons learned.