A library system
Difficulty:
One of the most classical examples of programming is creating a library system. Today you are going to do that ;-).
For the sake of simplicity our library only has one copy of each title.
Please note: The books file is a free public domain download from https://www.kaggle.com/jealousleopard/goodreadsbooks.
The system must meet the following requirements:
- When the program starts, the books in the library will be read from the given CSV file. Store the id (0), title (1), authors (2), average rating(3) and ISBN13 (5).
- The program must have a menu with the following options:
- (1) Search for books with a given title.
- (2) Search for books with a given author.
- (3) Search for books with a given ISBN
- (4) Print all top rated books. (with a rating higher ten 4.8)
- (5) Rent a book. The user can type in an id and than that book is marked as rented. Think about error handling
- (6) Return a book. The user can type in an id and than that book is marked as available. Think about error handling.
- (0) Quit the library system.
- The search system for title, author and isbn must only work if more than two characters a given as a search query. Use
contains
to search for a part of the title.
- The program must print books in nice way (See screenshots)
- A book that is rented must be colored red
Example output
Lets start with printing all top rated books.
(N.b. We know it’s a bit of a strange collection. This is because we don’t take the number of voters into account).
Then search for all books with an author with “Rowling” in the name.
Now rent the book with id 4.
And search again for all books with an author with “Rowling” in the name. Now it’s marked red.