Introduction
The Folio Society is a Book Club that sells fine books to customers all over the world. Each time a book is sold the Book-Number, the Number-of-Copies and a one character field indicating the Sale-Status (Normal Sale, Free Gift, Reduced Price (N,F,R)) is written to a Book-Sales-File.
A program is required to print a list of the ten best selling books (by copies sold) in the Book Club from the Book-Sales-File. Only Normal Sale books should be considered.
Files
Book Master File
The Book Master File is a sequential file sequenced on ascending Book-Number. The records have the following description;
|
FIELD |
TYPE |
LENGTH |
VALUE |
Book-Number |
9 |
5 |
00001-99999 |
Book-Title |
X |
25 |
- |
Author-Name |
X |
25 |
- |
Book Sales File
The Book Sales File is not in any particular sequence but we are guaranteed that a Book-Number that occurs in the file will have a corresponding entry in the Book Master File.
|
FIELD |
TYPE |
LENGTH |
VALUE |
Book-Number |
9 |
5 |
00001-99999 |
Number-Of-Copies |
9 |
2 |
1-99 |
Sale-Status |
X |
1 |
N,F,R |
Processing
Sort the Book Sales file throwing away unwanted records (F,R). Accumulate the sales for a book. If the book is in the top ten get the Book-Title and Author-Name from the Book Master File. When the Sorted Book Sales File has been processed, print out the top ten best sellers.
Print Specification
See print specification and example report.
The Sales field should be zero suppressed and have commas inserted as appropriate.
