Question
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
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started