{br} STUCK with your assignment? {br} When is it due? {br} Get FREE assistance. Page Title: {title}{br} Page URL: {url}
+1 917 8105386 [email protected]

• 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:
o The Serial number (consists of six digits)
o Book Title
o Book Authors
o Price
o Number of the copies available in the library.
o 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.

042431, Harry potter, J.K rowling, 20, 30, 12
042431, Harry potter, J.K rowling, 20, 30, 12
042431, Harry potter, J.K rowling, 20, 30, 12
042431, Harry potter, J.K rowling, 20, 30, 12
042431, Harry potter, J.K rowling, 20, 30, 12
042431, Harry potter, J.K rowling, 20, 30, 12

The information of the borrowed books are stored in a file called “BorrowedBooks.txt” The records in that file consists off:
o The Serial number of the borrowed book (Consist of 6 digits)
o The ID of the borrower.
042431, 7132002~~~~

• Project Requirements:

o 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 insensitive 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 0 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. And a 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 return 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.
  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 5 books.
     The user already borrows a coppy of the same book.
     No availabe copy of the book in the library (All were borrowed).
  6. Method to return a book:
    If the user chooses this option to return the book the user should be asked for the serial number and his ID. When it is returned “Library.txt” file should be modified in the record of the available books in the library should be increase by 1, and the number of borrowed books should decrease by 1.
    An appropriate message should be printed if:
     The book was returned successfully.
     The serial number of the book was not found/invalid

if the user enter an invalid menu option an appropriate message should be printed.

• Deliverables:

Each team should submit a:
o A report that contains:
 Description on how the team members approched this solution.
 Each team member’s contribution.
 Descriptions of the methods they created.

Our customer support team is here to answer your questions. Ask us anything!
WeCreativez WhatsApp Support
Support Supervisor
Brian
Available