Question
write by C not C++ (File Matching) As transactions occur (i.e., sales are made and cash payments arrive in the mail), theyre entered into a
write by C not C++
(File Matching) As transactions occur (i.e., sales are made and cash payments arrive in the mail), theyre entered into a file. At the end of each business period (i.e., a month for some companies, a week for others and a day in some cases) the file of transactions (called trans.txt) is applied to the master file (called oldmast.txt), thus updating each accounts record of purchases and payments. After each of these updates runs, the master file is rewritten as a new file(newmast.txt), which is them used at the end of the next business period to begin the updating process again. File-matching programs must deal with certain problems that do not exist in single-file programs. For example, a match does not always occur. A customer on the master file might not have made any purchases or cash payments in the current business period, and therefore no record for this customer will appear on the transaction file. Similarly, a customer who did make some purchases or cash payment might have just moved to this community, and the company may not have had a chance to create a master record for this customer. When a match occurs (i.e., records with the same account number appear on both the master file and the transaction file), add the dollar amount on the transaction file to the current balance on the master file and write the newmast.txt record. (Assume that purchases are indicated by positive amounts on the transaction file, and that payments are indicated by negative amounts.) When theres a master record for a particular account but no corresponding transaction record, merely write the master record, print the message Unmatched transaction record for account number.., (fill in the account number from the transaction record)
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