Skip to Main Content
Students' Guide to Program Design
book

Students' Guide to Program Design

by Lesley Anne Robertson
May 2014
Intermediate to advanced content levelIntermediate to advanced
188 pages
7h 8m
English
Newnes
Content preview from Students' Guide to Program Design
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Reinventing the Organization for GenAI and LLMs

Reinventing the Organization for GenAI and LLMs

Ethan Mollick

Publisher Resources

ISBN: 9781483141442