Unit 5.7 - Introduction to Database-Like Problems
PROG
Given a Table
| element# | PartNo | CustomerNo | Quantity |
| 1 | . | . | . |
| 2 | . | . | . |
A Price Table
A Customer Table
Update the Customer Tables with the Price
CONCEPTS
When the "key" is a small integer, we can use the subscripting mechanism
PSEUDOCODE
- read in price table
- zero out totals
- compute customer totals
- print customer totals
Refinement for Step 3
for each transaction
use the PartNo as a lookup to determine the price
Put total amount of order in OrderTotal
Using the CustomerNo as a subscript into Customer Table, add order quantity to appropriate place