Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given a book store brand ( say BS ) that has outlets in multiple cities of India. We are creating a database (
Given a book store brand say BS that has outlets in multiple cities of India. We are creating a database or a catalog to store details of all BS Stores. Each BS store has the following details that needs to be stored: storelD, city, state, booksList A linked list of books available in that store count number of books available in that store state can only take the following values AP UP RJ MH and DL city can be any string. Each book has the following details: bookID, title, author.
Create Structures for representing a BS store struct store and a book struct book Within declaration ensure that the state of a store can only take the abovementioned values. M
Write a function struct store createCatalogOfStoresint n that takes the number of stores n as the input parameter and creates an array for storing details of a number of stores. The array must reside on the heap. This function should then take n sets of inputs of city state from the user and populate the above created array with this information. The count of books for each store can be initialized to zero and the booksList for each store can be initialized to NULL. You can assign any integer values to storeID such that no two stores in the entire catalog have the same value of storeID. This function should return the array created M
Write a function struct book createBook that takes the information of title and author from the user, creates a new book on the heap and returns it You can assign any integer values to bookID such that no two books in the entire catalog have the same value of bookID. M
Write a function addBookstruct book b int sid that takes a book and a store id and inserts the book into the store with the given store id Assume that booksList points to the first book in the list if countM
Write a function find BookInAllStores int bid, struct store storeCatalog that finds whether a given book with bookdIDbid is available in any of the stores in storeCatalog or not. It prints the message "Book found in the store located in if the book is found, "Book not found!" otherwise. M
E Write a function sortBooksOfAIIStoresstruct store storesCatalog that sorts the booksList associated with each store in the storeCatalog. Sorting must be performed based on bookID. M
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