Question: its C program Write a menu driven C program to define an array of structures to store the details of 50 books in a Book

Write a menu driven C program to define an array of structures to store the details of 50 books in a Book Store. The details include Book name (string), Book price (float) and Book status (char) [Book status can have two possible values; either A (Available) or N (Not Available)]. The program should show a menu by calling the function ShowMenu and prompt the user to enter his choice. Program should call the below functions according to the user's choice. If the user selects the exit option, the program should exit. (30 marks) Program should create three user defined functions such as: a) void ShowMenu (void) - This function will display the following menu. (10 marks) 1. Add Book Details 2. Find the average price of the currently available books. 3. Exit b) void BookAdd (void) - This function is called when the user selects option 1. The function is used to add the details of a new book into the structure. The function should prompt the user to enter the new book details such as name, price and status and store it into the structure. If the user wants to add more than 50 books, then the following message should be printed on the screen. "Book cannot be added. You have reached the limit!" (25 marks) c) void BookAverage(void) - This function is called when the user selects option 2. This function should calculate and print the average price of all the currently available books in the book store. If the average price is more than 100, then print a message "Books are costly" else print "Books are cheap". (25 marks) Add your name and ID as comment at the beginning of the code. (5 marks) Output Format (5 marks) Sample Output 1. Add book details 2. Find the average price of the currently available books 3. Exit Choose any option : 1 Enter the book nane : Hanlet Enter the price of the book : 34.5 Enter the book status (A -Available N- Not Available ) : N Book details added successfully! 1. Add book details 2. Find the average price of the currently available books 3. Exit Choose any option : 1 Enter the book nane : Chosen Enter the price of the book : 45.5 Enter the book status (A -Available N- Not Available > : A Book details added successfully! 1. Add book details 2. Find the average price of the currently available books 3. Exit Choose any option : 1 Enter the book nane: Fireproof Enter the price of the book : 40.0 Enter the book status CA Available N- Not Available > : A Book details added successfully! 1. Add book details 2. Find the average price of the currently available books 3. Exit Choose any option : 2 Average price of all the currently available books - 42.8 Books are cheap 1. Add book details 2. Find the average price of the currently available books 3. Exit Choose any option : 3 Exiting
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
