
|
|
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.
- You can reuse the report from last week. Use the alternate
index "book-author" to read the records.
- Use a separate output file for your report.
- 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.
- You can reuse the report from last week. Use the alternate
index "book-price" to read the records.
- Use a separate output file for your report.
- The user should input the bottom value for the price range, as
well as the top value for the price range.
- Use the START command to find the first book record equal or
above the lower price.
- READ records and place them in the report, until you read a
record for a book above the top value in the price range
- Display a confirmation message to the screen, that the report
was created.
(3) Allow the user to delete a book given the book-id.
- The user should input a book-id.
- 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)
- 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)
- Display a confirmation message to the screen.
(4) Allow the user to modify a book price.
- The user should input a book-id.
- Your system should display the book record for that ID (or
give an error message stating that the book was not found)
- If the book was found, ask the user for the new price (and
also allow the user to cancel the change)
- If the user inputs a new price, use REWRITE to change the
price in the master file.
- Display a confirmation message to the screen.
last updated: 1/12/06
This page: hw10.htm