Question: ( i ) A bookshop uses a personal computer to maintain the inventory books that are being sold at the shop. The list includes details
i A bookshop uses a personal computer to maintain the inventory books that are being sold at the shop. The list includes details such as author, title, price, publisher, stock position. Whenever a customer wants a book, the shop keeper inputs the title and the author of the book and the system replies whether it is in the list or not. If it is not in the list, an appropriate message is displayed. If book is in the list, then the system displays the book details and asks for number of copies. If the required copies are available, the total cost of the book is displayed; otherwise the message "Required copies not in stock is displayed.
Requirements:
Implement a structure named bookRecord with the following attributes:
Title string
Author stringDefine a functions to operate on the book records for adding a new book in to the list.Prompt the user to input details for the new book and add it to the array of books.Update the number of books accordingly.Define a functions to display the details of all books in the shop.Define a functions to search for a book by its title and author of the book and display its details if found. Provide appropriate messages if the book is not found.Define a function that calculates the total amount a customer must pay after buying a specified number of books from the bookstore.Update the availability of the book accordingly.Display appropriate messages indicating the success or failure of the selling process.Write a main function to test your implementation. The main function should provide a menudriven interface allowing users to:QEAD. Template ARev: ver Date: October Page of FQAPAdd a new book to the listarrayDisplay all books in the shop.The design must include any one validation metric for user inputs.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
