New Jersey Institute of Technology
College of Computing Sciences
CIS365: File Structures and Management
Rich Egan

A Public Research University


Homework #H10: Indexes 

Part 1: Index Program

This assignment builds upon the program you wrote for homework H9. Extend the book master file program you wrote by adding the following functions. Add a menu so the user can access each function;

(1) Create a report that lists all the books in the system, sorted by book-author to an output report file.

  1. You can reuse the report from last week. Use the alternate index "book-author" to read the records.
  2. Use a separate output file for your report.
  3. Display a confirmation message to the screen, that the report was created.

(2) Create a report that lists all the books in the system within a certain price range, sorted by price to an output report file.

  1. You can reuse the report from last week. Use the alternate index "book-price" to read the records.
  2. Use a separate output file for your report.
  3. The user should input the bottom value for the price range, as well as the top value for the price range.
  4. Use the START command to find the first book record equal or above the lower price.
  5. READ records and place them in the report, until you read a record for a book above the top value in the price range
  6. Display a confirmation message to the screen, that the report was created.

(3) Allow the user to delete a book given the book-id.

  1. The user should input a book-id.
  2. Your system should display the book record for that ID and ask the user to confirm whether to delete that specific book (or give an error message stating that the book was not found)
  3. Your system should delete that book if the user has confirmed, and not delete it if the user changed his or her mind (or the book was not found)
  4. Display a confirmation message to the screen.

(4) Allow the user to modify a book price.

  1. The user should input a book-id.
  2. Your system should display the book record for that ID (or give an error message stating that the book was not found)
  3. If the book was found, ask the user for the new price (and also allow the user to cancel the change)
  4. If the user inputs a new price, use REWRITE to change the price in the master file.
  5. Display a confirmation message to the screen.


last updated: 1/12/06

This page: hw10.htm