Question: Task ( individual ) Write a C program that represents a book ( book _ title, author name & book _ id ) as a
Task
individual
Write a C program that represents a book booktitle, author name & bookid as a struct.
writedata: takes a list of book structs and a file name, then writes the structs to a file with the name given l point
loaddata: takes a file name on which book structs are stored and loads it in a list data structure in memory, then returns the list data structure
point
searchbyid: takes a list of book structs and a bookid then returns the struct object with the given id if it exists point
In main point:
Prompt the user to choose whether to:
a Load data.
b Enter data.
c Search by id
d Exit the program
If a b or c are chosen, then prompt the user to enter the name of the file.
If a is chosen, then use loaddata and print the list in table format on the screen.
If b is chosen, then allow the user to keep entering book structs data till a reserved character is entered. Next, use writedata to write the data to a
file with the name given. Note: You are NOT allowed to assume an upper limit on the number of struct objects the user will enter.
If d is chosen, then exit the program.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
