Home / Expert Answers / Computer Science / c-program-a-program-is-required-to-produce-a-database-of-books-for-a-library-it-is-decided-that-a-pa249

(Solved): c program A program is required to produce a database of books for a library. It is decided that a ...



c program

A program is required to produce a database of books for a library. It is decided that an array of structures will be used to

A program is required to produce a database of books for a library. It is decided that an array of structures will be used to produce the database. The information stored about each book is as follows i Title ii Author iii ISBN number (13 digit number) iv Number of copies Perform the following tasks: (a) Explain the advantages/disadvantages of using an array to store the database. ( 2 marks for each advantage/disadvantage). (4) (b) Write an appropriate structure to represent the books and declare an array of them in function main(). Write code to initialise all members of each structure in the array to NULL or 0 as appropriate for each variable type chosen. (c) Write a user-defined function that can fill all of the members of one structure in the array and show how that function would be called.


We have an Answer from Expert

View Expert Answer

Expert Answer


a) ADVANTAGES: When we use an array of structures we can access the elements of the array which are structures with indexes. The accessing is done with O(1). DISADVANTAGES: Memory wastage. When we want to remove the element the allocated memory will
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe