Thread: Book management program

  1. #1
    Registered User
    Join Date
    May 2016
    Posts
    1

    Book management program

    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.

  2. #2
    Registered User rstanley's Avatar
    Join Date
    Jun 2014
    Location
    New York, NY
    Posts
    1,111
    Please read both the Forum Guidelines, and the Homework Policy!

    You should pass the "book" and the "List bList" by pointers, and the filename as a const char *, and return a "book", and "list" by pointer as well.

    Instead of:

    Code:
    list load (char * filename, list bList);
    it should be:
    Code:
    list load *(const char * filename, list *bList);
    And similar for other functions.

  3. #3
    Registered User
    Join Date
    Jun 2015
    Posts
    1,640
    You asked for a code. Here's a simple one:
    CN XNTQ NVM GNLDVNQJ

    As for tips, don't put your entire description in code tags as it makes it difficult to read.

    BTW, people would be willing to help you if you show some effort. Post some code.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Student Management Program help
    By 1997king2 in forum C Programming
    Replies: 1
    Last Post: 11-28-2015, 04:28 PM
  2. Replies: 2
    Last Post: 09-04-2011, 06:36 AM
  3. Replies: 2
    Last Post: 04-03-2009, 05:57 PM
  4. I need help with this program its from a C++ book
    By dark21 in forum C++ Programming
    Replies: 7
    Last Post: 03-27-2009, 03:30 AM
  5. A good book for someone who already can program?
    By QuestionC in forum C++ Programming
    Replies: 1
    Last Post: 02-08-2002, 02:23 AM

Tags for this Thread