The objective of this assignment is to practice working with structures and to learn binary file I/O using the fread() function.
The title field contains the title of the book and the author field contains the name of the primary author. The kind field has value 1, 2 or 3, representing respectively whether the book is a paperback, a hard cover or an audio "book on tape". The year field stores the year that the book was published and the price field contains the price of the book.
Your assignment is to write a program that allows a user to search these files for books that fit some user-specified criteria. Your program should allow the user to direct the search in just one of the four files or in all four files. The user should be able to select books based on the title, the author or the price. When the selection is by title or by author, a book is considered a match if the string specified by the user is a substring of the title field or the author field. For example, if the user enters "Asimov", then the book titled "Isaac Asimov : The Complete Stories Vol 1" should be selected in a search by title. In search by price, a book with a price less than that entered by the user should be considered a match. Your program should print out the information on the books that were selected by the user's search.
Please include the following statement in the comment section of your program:
I have read and I understand the course policy on cheating. By submitting the following program, I am stating that the program was produced by my individual effort.
You will turn in your program using the UNIX submit utility -- details will be announced shortly. For this project, please keep all your functions in one file. Create a transcript of running your program using the script utility. You should choose examples that demonstrate the correctness and robustness of your program. Submit only your source code and the transcript.
This project is due by midnight (1 minute after 11:59pm) on Wednesday, February 11, 1998. We will use the system clock as the final arbiter of time and date. If you turn in your project on time, you will receive a 5% bonus on your project grade. There is a grace period of 2 days, but after midnight on Friday, February 13, no more projects will be accepted.