You are to create a new computerised library management system to replace the old one. This description details the requirements of the new system. The Library System will consist of two main components, an administrative component, and a catalogue. The administrative section will allow, through text-based menus, the addition and removal of patrons, the addition and removal of books in the catalogue, the display of patron records and the display of a patron's 3 favourite books. The catalogue will store a list of all the books in the library, a list of the genres of those books, a list of all the authors with books in the library and a list of the books on loan. The catalogue will also allow the display of the books in a number of ways, including by availability, genre and author. Finally, the catalogue will also handle the borrowing and return of books, and the placing of holds on books. Each patron record will include the patrons name, their chosen ID number, which books they are currently borrowing and their full borrowing history. Each book record will include the books title, its author and its genre.
OO Design, Standard Patterns, Lists
Your design will consist of exactly the following classes with the listed fields, declared as indicated. You may not add or remove classes or fields, however you may add constructors, functions and procedures to complete your design. Any violation of the requirements will result in mark deduction and will be shown in the manual feedback.
To help visualise the design, a partial class diagram has been provided - This doesn't have everything you need. see image.
Fields
Constructors
toString()
The main method of the program will be in the Library class.
Holds- the library should also implement a hold system.
To achieve a mark of >84, you must implement a favourites reporting function (or set of functions). This corresponds to an item in the main menu (see the trace above). Choosing this option should prompt the user for a valid patron ID, and then display the user's 3 most borrowed books, in order of highest borrowing frequency to lowest. If the user has only borrowed less than three books, it will show those books alone.
Below is a sample I/O trace. The bold text indicates user input (you are not expected to print bold text). Not every conceivable scenario is shown below.
Welcome to the Library! Please make a selection from the menu:
1. Explore the catalogue.
2. View your patron record.
3. Show you favourite books.
4. Enter Admin Mode.
X. Exit the system.
Enter a choice: 4
Welcome to the administration menu:
1. Add a patron.
2. Remove a patron.
3. Add a book to the catalogue.
4. Remove a book from the catalogue.
R. Return to the previous menu.
Enter a choice: 1
Adding a new patron.
Enter a new ID: 42
Enter the patron's name: Angela Huo
Patron added.
Welcome to the administration menu:
1. Add a patron.
2. Remove a patron.
3. Add a book to the catalogue.
4. Remove a book from the catalogue.
R. Return to the previous menu.
Enter a choice: 3
Adding a new book.
Enter the title of the book: Effective Java
Enter the author's name: Joshua Bloch
Enter the genre: reference
Added Effective Java to catalogue.
Welcome to the administration menu:
1. Add a patron.
2. Remove a patron.
3. Add a book to the catalogue.
4. Remove a book from the catalogue.
R. Return to the previous menu.
Enter a choice: R
Welcome to the Library! Please make a selection from the menu:
1. Explore the catalogue.
2. View your patron record.
3. Show you favourite books.
4. Enter Admin Mode.
X. Exit the system.
Enter a choice: 1
Welcome to the Catalogue! Please make a selection from the
menu:
1. Display all books.
2. Display all available books.
3. Display all genres.
4. Display books in a genre.
5. Display all authors.
6. Display all books by an author.
7. Borrow a book.
8. Return a book.
9. Place a hold.
R. Return to previous menu.
Enter a choice: 1
The Library has the following books:
Joshua Bloch, Effective Java
Welcome to the Catalogue! Please make a selection from the
menu:
1. Display all books.
2. Display all available books.
3. Display all genres.
4. Display books in a genre.
5. Display all authors.
6. Display all books by an author.
7. Borrow a book.
8. Return a book.
9. Place a hold.
R. Return to previous menu.
Enter a choice: 3
The Library has books in the following genres:
reference
Welcome to the Catalogue! Please make a selection from the menu:
1. Display all books.
2. Display all available books.
3. Display all genres.
4. Display books in a genre.
5. Display all authors.
6. Display all books by an author.
7. Borrow a book.
8. Return a book.
9. Place a hold.
R. Return to previous menu.
Enter a choice: 5
The following authors have books in this Library:
Joshua Bloch
Welcome to the Catalogue! Please make a selection from the menu:
1. Display all books.
2. Display all available books.
3. Display all genres.
4. Display books in a genre.
5. Display all authors.
6. Display all books by an author.
7. Borrow a book.
8. Return a book.
9. Place a hold.
R. Return to previous menu.
Enter a choice: 7
Enter a valid patron ID: 42
Enter the title of the book you wish to borrow: Effective Java
Book loaned.
Welcome to the Catalogue! Please make a selection from the menu:
1. Display all books.
2. Display all available books.
3. Display all genres.
4. Display books in a genre.
5. Display all authors.
6. Display all books by an author.
7. Borrow a book.
8. Return a book.
9. Place a hold.
R. Return to previous menu.
Enter a choice: 2
The following books are on the shelf:
Welcome to the Catalogue! Please make a selection from the menu:
1. Display all books.
2. Display all available books.
3. Display all genres.
4. Display books in a genre.
5. Display all authors.
6. Display all books by an author.
7. Borrow a book.
8. Return a book.
9. Place a hold.
R. Return to previous menu.
Enter a choice: 8
Enter a valid patron ID: 42
Luke Mathieson has the following books:
Books currently borrowed by Angela Huo:
Joshua Bloch, Effective Java
Enter the title of the book you wish to return: Effective Java
Effective Java has been returned.
Welcome to the Catalogue! Please make a selection from the menu:
1. Display all books.
2. Display all available books.
3. Display all genres.
4. Display books in a genre.
5. Display all authors.
6. Display all books by an author.
7. Borrow a book.
8. Return a book.
9. Place a hold.
R. Return to previous menu.
Enter a choice: R
Welcome to the Library! Please make a selection from the menu:
1. Explore the catalogue.
2. View your patron record.
3. Show you favourite books.
4. Enter Admin Mode.
X. Exit the system.
Enter a choice: x
A sample partial I/O trace for Advanced Requirements:
Welcome to the Library! Please make a selection from the menu:
1. Explore the catalogue.
2. View your patron record.
3. Show you favourite books.
4. Enter Admin Mode.
X. Exit the system.
Enter a choice: 3
Enter a patron ID: 42
Angela Huo's favourite books are:
David Foster Wallace, Infinite Jest
Tim Powers, The Anubis Gates
Christopher Priest, The Islanders