In this assignment, you're required to create a book list for a small library. With this program, you will be able to print the list of books, search books in the library list, search for writer info of book, add a new book to the list and remove a book from the list. The maximum size of the book list will be 100. You will ask the user to choose one of the options repeatedly until the user chooses the Quit option (until the user enters number 6). The options menu must be the same as with the following screenshot. All the functionalities on this library system are explained below.

Figure: see image.

Follow the steps described below.

1. Declare "writer_info" and book_info structures

a. "writer_info must have the following as members; writer's name, surname and number of book.

name char(max size:15)
surname char(max size: 20)
number_of_book Int

Members of writer_info structure.

b. "book_info" will have book name, book's writer and first publication year as members.

book_name char(max size:20)
writer writer_info
first_publication_year Int

Members of book_info structure.

2. Define the following functions

void print_book_info(book_info* book_list);
void search_book(book_info* book_list);
void add_new_book(book_info* book_list);
book_info create_new_book(char* bName, writer_info writer, int pubYear);
void remove_book(book_info* book_list);
void find_writer_info(book_info* book_list, char* book_name);

a. Function: void print_book_info(book_info *book_list);

The purpose of this function is to print all the members of the book list by displaying the book name, name and surname of the book's writer and first publication date of the book. see image.

b. Function : void search_book(book_info *book_list);

The purpose of this function is to search for a book in the book list with the supplied information. Users can search books by entering their name, writer's name, writers surname or first publication year. If the book exists in the book list, then the number of the book will be printed. If it is not on the list, the program simply prints a message. Please note that one writer can have more than one book, or first publication year can be the same for different books. see image.

c. Function: void find_writer_info(book_info *book_list, char *book_name);

The purpose of this function is to find writer information of a book in the book list if it is included in the list. see image.

d. book_info create_new_book(char* bName, writer_info writer, int pubYear);

This function takes bookName, writer info and publication year as arguments and returns the info of new book.

e. Function: void add_new_book(book_info *book_list);

The purpose of this function is to add a new book to the list using the information returned by create_new_book(). (The function above) see image.

f. Function: void remove_book(book_info *book_list);

The purpose of this function is remove a book from the book list and to print the new list immediately afterwards. The index value of delete_item will be entered by user. see image.

3. Write your test code and call all the functions described above. Be sure that your functions work properly under different cases.

4. Write a report that explains each part of your program and functions in detail. (E.g, Give detailed information for each function by providing your function prototypes, declarations, local/global variables, arrays and explanations on them)

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.