Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Simplistically, how would I go about writing a code using structswith the functi

ID: 3618128 • Letter: S

Question

Simplistically, how would I go about writing a code using structswith the functionality of:
1) adding books to a "library", 2) deleting books, 3) search for books in the collection, 4) and list all the books in the colletion by author 5) list all the books by subject.
The library of books would be from an input file in thefollowing format. TITLE AUTHOR SUBJECT
1) adding books to a "library", 2) deleting books, 3) search for books in the collection, 4) and list all the books in the colletion by author 5) list all the books by subject.
The library of books would be from an input file in thefollowing format. TITLE AUTHOR SUBJECT

Explanation / Answer

x.Hlor="red">please rate - thanks sorry don't know how to do delete #include #define MAX_LENGTH 40 #define MAX_BOOKS 1000 struct library {        char author[MAX_LENGTH];        char title[MAX_LENGTH];        char subject[MAX_LENGTH]; }; //I believe I will need more functions here but I don't really think that they would be //necessary int strncmp(char[],char[],int); void inputLibrary(struct library* ,FILE* ,int); void printLibrary(struct library*,int,int,FILE* ); void searchLibrary(struct library*,int,FILE* ); void deleteLibrary(struct library*,int*,FILE* ); int main(void) {     //declaring the struct and naming it "ILibrary"     struct library ILibrary[MAX_BOOKS];     //I have this function here to read through the text file and get all     //of the information     int books=0;        FILE* fin;     fin = fopen("library.txt", "r");           int choice,num,i;     fscanf(fin,"%d",&num);     for(i=0;ititle, (x+i)->subject);            if(i==*n-1)               *n=*n-1;            else               for(j=i;jauthor, (x+i)->title, (x+i)->subject);            return;            }    printf("book not found: %s ", what); } // I use this to read the text file. Am I supposed to put "fin" in with the function name? void inputLibrary(struct library *x ,FILE* fin,int i) {      int numUpdates;          fscanf(fin, "%s",(x+i)->title);      fscanf(fin, "%s",(x+i)->author);      fscanf(fin, "%s",(x+i)->subject);      printf("added to the library: %s %s %s ", (x+i)->author, (x+i)->title, (x+i)->subject);     } // I figure I will need this print out whichever option the user picks? void printLibrary(struct library* x,int n,int type,FILE* fin) { int i,j,len;    char what[MAX_LENGTH];    fscanf(fin, "%s",&what);    len=strlen(what);    if(type==4)        printf("List of all books by %s ",what);    else     printf("List of all books on %s ",what);      for(i=0;iauthor,len)==0)                    printf("   %s %s %s ", (x+i)->author, (x+i)->title, (x+i)->subject);                           break;       case 5: