Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using C Let us work on the menu of a library. Create a structure containing book information like accession number, name of author, book title
Using C
Let us work on the menu of a library. Create a structure containing book information like accession number, name of author, book title and flag to know whether a book is issued or not. Create an interactive menu in which the following can be done. 1 - Display book information 2 - Add a new book 3 - Display all the books in the library of a particular author 4 - Display the number of books of a particular title 5 - Display the total number of books in the library 6 - Issue a book (If we issue a book, then its number gets decreased by 1 and if we add a book, its number gets increased by 1) To guide your answer, you can follow the code skeleton provided bellow: struct book { int and char title-01 char author: Ast issued vold display(struct book b) printf("Accession number of Books muthoritsin",b.am, b. title, b.author); r(b.issued awa) C printf("Issued-ton"); > else ( printf("Issued-1tYesin"); ) void add() 1 1/Do yourself Irissued will be by deratut > 1/passing array vold book_by_author(struct book *b, int number_of_books, char auth()) int i; for(ienumber_of_books; 1.) 21(strcmp((1+1)--author, auth) { display(+(be)); ) vold bool_by_utte) { //do 1f yourself > void issue.book(struct book b) { b.issued int() ( !!write yoursell return; Sample Output: ***** MENU ***** 1- Display Book Information 2- Add new Book 3- Display All the books in the library of a particular author 4- Display the number of books of a particular title 5- Display the total number of books in the library 6- Issue a Book Please Enter Your choice: 5 The total number of books in the library is: 0 MENU ** 1- Display Book Information 2- Add new Book 3- Display All the books in the library of a particular author 4- Display the number of books of a particular title 5- Display the total number of books in the library 6- Issue a Book Please Enter Your choice: Further Instructions: As shown in the screen-shot above, the initial number of books in the library is o Displaying a book's information should include its four attributes (shown in skeleton code). Use proper printf messages (no standard format is enforced). . Similarly, for adding a book, prompt the user for all four attributes with proper I/O. . For displaying all books of a given author, first prompt the user for the author's name, then use the same display format in question 1 for all books of that author. Displaying the total number of books in the library should exclude all books for which the issued flag was set to 1 For your report, add at least 5 books to your library and take screenshots demonstrating each of the Menu's options Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started