Answered step by step
Verified Expert Solution
Link Copied!

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 above-mentioned values. [6M]
Write a function struct store createCatalogOfStores(int 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 [8M]
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. [4M]
Write a function addBook(struct 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 count>=1).[4M]
Write a function find BookInAllStores (int bid, struct store storeCatalog) that finds whether a given book with bookdID=bid 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. [6M]
E. Write a function sortBooksOfAIIStores(struct store storesCatalog) that sorts the booksList associated with each store in the storeCatalog. Sorting must be performed based on bookID. [12M]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions