Question: Please can you use the C language. Library.bin attached as google drive link: https://drive.google.com/open?id=1JdvzO9gFxuVs5Mkvhu0tc3fUT6Ekp0l You are given a binary file library.bin (you can download from
Please can you use the C language.

Library.bin attached as google drive link: https://drive.google.com/open?id=1JdvzO9gFxuVs5Mkvhu0tc3fUT6Ekp0l
You are given a binary file library.bin (you can download from Moodle) which contains records of books in a library. Each book record will be stored using bookData struct. typedef struct { int id; // book id char name[20]; // book name char author[20]; // author of book int quantity; // quantity of book int rackno; // rack no of the book } bookData; Library.bin file consists of 100 records. 96 of them are blank records. The other 4 records (not blank) are placed in specific positions of the binary file based on their ids. For example, if id of the book is 5, its record is the fifth record in the file. The size of each record is equal to the size of bookData struct. The records are sorted according to their id number. Implement the following functions: void showRecords() - it shows and lists all records in the binary file. int updateRecord(int id, int diff) - This function updates quantity of the book whose id is provided in the parameter id. The update is performed by adding the number in the parameter diff to the quantity of the book with the given id. If there is a book record with the given id, the new quantity of the book is written to library.bin and the function returns 1; otherwise, it returns 0. int deleteRecord(int id) - This function removes the book with the given id from binary file (library.bin) by setting its fields to (0, "", ",0, 0). If the given id is found in the binary file, the book record will be removed from the binary file and the function returns 1; otherwise, it returns 0. A skeleton code (lab5pre_skeleton.c) provided in Moodle. Note that, in each function, you should open library.bin, perform your task, and close the file. In showRecords fuction, open the file with "rb", in updateRecord and deleteRecord function open the file with "rb+". Hint: fseek() is used to move file pointer associated with a given file to a specific position. You need to use fseek () function to add, update and delete any record in binary file.
Step by Step Solution
3.47 Rating (154 Votes )
There are 3 Steps involved in it
To implement the required functions in C youll need to follow these steps Ill provide example implementations for each of the functions showRecords up... View full answer
Get step-by-step solutions from verified subject matter experts
