Create a system managing a mini library system. Every book corresponds to a reco
ID: 3775589 • Letter: C
Question
Create a system managing a mini library system. Every book corresponds to a record (line) in a text file named "mylibrary.txt". Each record consists of 6 fields (Book ID, Title, Author, Possession, Checked out Date, Due Date) separated by comma: 1, Book1, Author, Library, null, null 2, Book1, Author1, User1, 2014-10-22, 2014-11-21 3, Book2, Author2, User1, 2014-10-23, 2014-11-22 4, Book3, Author2, User2, 2014-10-23, 2014-11-22 5, Book4, Atuhor3, User2, 2014-09-22, 2014-10-22 No comma ", "in title or author name. This mini library keeps the record for each book in the library. Different books can share the book "Title". But the "Book ID" for each book is unique. One author may have multiple books. Eg. Both book2 and book3 are written by author1 Possession field is "Library" means this book is kept in library, such as book #001. Otherwise, this book is checked out by the corresponding user. E.g. book #3 is checked out by User1. A user is allowed to check out up to 3 books. The "Checked out Date" field specifies the time of the latest checked out date. The loan period for each book is 30 days. "The Due Data" filed specifies the time the book should be returned. This system should provide a menu with following functionalities that the bookkeeper can choose from at the top-level menu: Enter "o" to check out a book Ask for user name. Count how many books this user has already checked out, only proceed the current checkout if less than 3 (go to 3)). Otherwise, go to 5) Ask for book Id, examine if this book exists. If no, print a message "No such book!" and then go to 5). Otherwise, 4) Update the possession, "check out date" and "due date" field of the corresponding book record. After that, print message "book*** checked out successfully!" and then go to 5). Provide options "t" for "" or "b" for "Back to main menu". (If "", go to step 1))Explanation / Answer
#include #include #include struct library { char author[20],title[20],pub[20]; int price; library *next; }; int sum=0; void main() { clrscr(); library *head=NULL; library *initial(void); library *purchase(library *); //library *sale(library *);void display(library *); void stock(library *); void search(library *); int choice; while(1) { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.