Using the sample solution algorithms provided in this chapter, design a solution algorithm for the following programming problems. Your solution should contain:
• a defining diagram
• a hierarchy chart
• a pseudocode algorithm
• a desk check of the solution.
The Yummy Chocolates confectionery company requires a program to sequentially update its customer master file. A sequential file of update transactions is to be used as the input transaction file, along with the customer master file.
The customer master file contains the customer number, name, address (street, city, state and postcode) and account balance. The customer transaction file also contains these fields, as well as a transaction code of ‘A’ (add), ‘D’ (delete) and ‘U’ (update).
Both files have been sorted into customer number sequence. There can be multiple update transactions for any one customer master record and a new customer master file is to be created. Transaction records are to be processed as follows:
i If the transaction record is an ‘Add’, the transaction is to be written to the new customer master file.
ii If the transaction record is a ‘Delete’, the old master record with the same customer number is not to be written to the new customer master file.
iii If the transaction record is an update, the old master record with the same customer number is to be updated as follows:
if customer name is present, update customer name
if street is present, update street if town is present, update town
if state is present, update state
if postcode is present, update postcode
if balance paid is present, subtract balance paid from account balance on old customer master record.
As each transaction is processed, print the transaction details on the customer master audit report, with the message, ‘record added’, ‘record deleted’ or ‘record updated’ as applicable.
If a transaction record is in error, the transaction details are to be printed on the customer update errors report, with one of the following messages:
‘invalid addition, customer already exists’
‘invalid deletion, customer not on file’
‘invalid update, customer not on file’.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.