Page 1 of 1

Project Description Information available of the All the books in a certain library are stored in a file called "Library

Posted: Mon May 02, 2022 12:26 pm
by answerhappygod
Project Description Information Available Of The All The Books In A Certain Library Are Stored In A File Called Library 1
Project Description Information Available Of The All The Books In A Certain Library Are Stored In A File Called Library 1 (42.72 KiB) Viewed 50 times
Project Description Information Available Of The All The Books In A Certain Library Are Stored In A File Called Library 2
Project Description Information Available Of The All The Books In A Certain Library Are Stored In A File Called Library 2 (60.2 KiB) Viewed 50 times
Project Description Information available of the All the books in a certain library are stored in a file called "Library.txt". Each line in the file is a record about a book's unique information. The provided books informations in that line are: The Serial number (consists of six digits) o Book Title o Book Authors o Price o Number of the copies available in the library. Number of the books borrowed from the libray Each of those information is seperated with a comma, and the authors are seperated with a colon. The information of the borrowed books are stored in a file called "BorrowedBooks.txt" The records in that file consists off: The Serial number of the borrowed book (Consist of 6 digits) o The ID of the borrower. • Project Requirements: 0 You program should should be a menu-driven one where the user will be asked to choose certain option and the program should continue to show the menu again as long as the user does not choose to exit Sample Output: Library System: 1. Search for a book 2. Add new book 3. Remove a book 4. Print the bookss information 5. Borrow a book 6. Return a book 7. Exit What is your choice:
Further details on the system: 1. Methods to search for a book If the user chooses that option he should be asked of he wants to search for it using the book's title (or part of it) or using the name of one of the authors (or part of the name) Depending on that search the user should go through the Library.txt" file and print all the books matching that certain criteria And if none was found an appropriate message should be printed (the search needs to be case sensitive as the user can search using lower case letters or upper case one) 2. Method to add new book If the user chooses this option then the user needs to enter the required information for the book except for the number of borrowed books as that one should be made to o when it is first added Few things you need to check for: The user should be asked about the number of the authors and depending on that he enters the authors name (remember when you add them the names are seperated by a colon) There must be at least one author name entered. The serial number is unique and should be validated as contianing 6 digits and that number should not exist in the file before). The title cannot be empty Price is a double positive number Number of currently available books should be a positive integer Once all those information are entered and are valid a record is add to the "Library.txt" file. Anda message telling the user it was added successfully should be printed otherwise an appropriate message should be printed 3. Method to remove a book: If the user chooses that option then he should be asked for the serial number (if an invalid serial number was given as in doesn't contain 6 digits an appropriate message should be printed And then the user should be asked to either enter another serial number or retum to the previous menu) If the serial number doesn't exist in the "Library.txt" file then an appropriate message should be printed. Once the serial number is found then its record should be removed from the Library.txt" though the book can only be removed if no copies of it were borrowed and if they were an appropriate message should be printed. II 4. Method to print a book's information: If the user chooses this method then information on all of the the books in the file should be printed 5. Method to borrow a book: If the user chooses this option here are some rules to follow A user can only borrow 5 books. A user cannot borrow more than the same copy of a book at the same time. To borrow the book the user should be asked for the serial number and his ID. When it is borrowed "Library.txt" file should be modified in the record of the available books in the library should be dcreased by 1, and the number of borrowed books should increase by 1. "BorrowedBooks.txt" should be edited to add the serial number and the ID to it after it is successfully borrowed An appropriate message should be printed if The book was borrowed successfully. The serial number of the book was not found invalid. The user already borrowed