
Students' Guide to
Program
Design
Example 6.4 Produce Sales Report
Design a program which will
read
a file of sales records and
produce
a
sales report. The first record in the file contains the number of records
in the file (N). Every other record in the file contains a customer's
number, name, a sales amount and a discount code.
The discount code is to be
applied
to the sales amount to
determine
the discount due on that sale, as follows:
Discount Code
0
1
2
Discount
nil discount
3% discount
5% discount
This report is to print a heading 'SALES REPORT' and detail lines
listing the customer number, name, sales amount, discount and total
amoun ...