In this project, you should develop a library management system application using structures and files. More specifically, your application should enable a user to read and write book details to a...


In this project, you should develop a library management system application using structures
and files. More specifically, your application should enable a user to read and write book
details to a file (books.txt). The file should store the following information for the books. One
line per book and each field to be separated by tab.
• Book ISBN
• Book title
• Author first name
• Author surname
• Year
• Availability for loan [yes/no]
The user of this application should have the following options in the form of a nice presented
menu.
Add a book: The user should add all the details of each book by answering a set of questions
(book isbn? Book title? author? year?). The availability for loan is randomly generated by the
program (y: yes, n:no). The book should be added at the end of the file.
Search for a book: The user should be given three options here.
▪ Search by the title: The user will input a keyword and the program will
search for all the titles that contain this keyword and display all the
information of the corresponding books.
▪ Search by the author: The user will give the full name of an author and
the program will display all the information of the books by that author.
▪ Search by year: The user will give as input a year and the program will
display all the information of the books published that year.
Total # of books: Print all the books in the file, one on each line, and count the total number
of books in the file.
Borrow a book: All the books that are available to borrow are displayed in the screen.
After the execution of each one of the above options (the underlined phrases above) the
user should be asked if she/he wishes to select another option or exit the program.
Your program should check if the file (books.txt) exists and if not it should display the
appropriate error message.
Bonus (+10%): Assume that your book catalogue is sorted (according to the book title).
The “add book” functionality, should add the book to the appropriate place in the file so
that the file remains sorted after the addition of the new book. You can implement this
bonus question as an extra option 6. Add new book sorted and use two files for testing
(books.txt and books_sorted.txt).


INSTRUCTIONS:
1. Create the structure Book to store the details about the book and a second structure
Author to store the first name and surname of the author. The structure Author will
be part of the structure Book.
2. Create a file book.txt to write and read from the file.
3. Use functions where appropriate.
4. Submit the .cpp file by uploading it on moodle (.cpp file ONLY). PLEASE name the file
as follows: Project2.cpp
5. The examiner will attach great importance to the quality of code. Marks will be
deducted for poor programming style. The program should be commented and
indented to aid clarity.
6. You may only use the C++ programming concepts covered so far in class. Do not use
material that was not covered in this class. You are allowed to use only Cstring library
not String

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here