Hey, guys! I've read and I know that I shouldn't ask help with a whole assignment but I need a lot of help. So if anyone can provide a code or any tips on how to start (or anything for that matter) that would be much appreciated. My assignment is the following:
For this assignment you'll have to make
a book managemnt program in C.Each book Each book will be represented by a struct of the form:
Code:
struct bookR{
char author[MAXSTRING];
enum genres genre;
int id;
char review[MAXLINES][ MAXSTRING];
};
The MAXSTRING indicates the maximum size (in characters) of each string while MAXLINES the maximum Number of lines in a review. You should be able to modify a simple change to a preprocessor command.
For each book we define a pointer to use the functions :
typedef struct bookR * book;
The genres field contains the following
categories :fiction,scientific, politics
The program should allow you the declaration of new books and assignment of unique id , deleting records by id , searching by id , changing the book data and finally printing the data of one or all of the books.
Additionally your program should allow
you to keep a list of books even if you exit the program and restart
it . To do this you need to keep records in a file which will "
load " at the beginning of your program . The file name will be
given from the command line . If the file does not exist then it is
created. The data and changes made by the user should be stored in
the file .
You should create the following functions (DO NOT modify the signature):
void printMenu ();
void print (book b);
list load (char * filename, list bList); // Retrieve book list from a file
void save (char * filename, list bList); // Save the book list file
void addBook (book b, list bList);
book findBook (book b, list bList); //Search by b-> id
void deleteBook (book b, list bList);// Delete by b-> id
void updateBook (book b, list bList);// Renewal by b-> id
The signatures and other information (eg stuct) should be in your own header titled : "books.h" while the function implementations should be at the "books.c" file . In "main.c" file will be only the function calls,
the initialization of variables and the manipulation of the user
input .
Finally the list list is a pointer to a linked list that implements the structure to store and manage book records in memory.
Sorry for the long post and I hope that I will get some help. Thank you and have a nice day.