Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here are the specefications for the project. Please let me know if you need more information or if there's anything I can help with. Thanks!

Here are the specefications for the project. Please let me know if you need more information or if there's anything I can help with. Thanks!

The assignment's sumbmission requires 5 seperate python files that are specefied below:

Submission:

fileMatchingFuncs.py,

fileMatching.py,

funcsTests.py,

sorted_oldMaster.dat, and

newMaster.dat.

Program Description:

In commercial data processing, its common to have several files in each system. In an accounts receivable system, for example, there is generally a master file containing detailed information about each customer such as the customers name, address, telephone number, outstanding balance, credit limit, discount terms, contract arrangements and possibly a condensed history of recent purchases and cash payments. In this program, we only stored the customers account number, customers first and last name, customers balance, customers phone number, and customers city.

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 "transaction.dat") is applied to the master file (called "oldMaster.dat"), thus updating each account's record of purchases and payments. After each of these updates, the master file is rewritten as a new file ("newMaster.dat"), which is then 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 payments might have just moved to this community and the company may not have had a chance to create a master record for this customer.

Use the account number on each file as the record key for matching purposes. The oldMaster.dat is not ordered. You need to read the file and generate a sequential file, which is

sorted in increasing account number order. This sequential file will be sorted_oldMaster.dat. The transaction.dat file has records of account numbers and value. 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 "newMaster.dat" record. (Assume that purchases are indicated by positive amounts on the transaction file, and that payments are indicated by negative amounts.)

When there is a master record for a particular account but no corresponding transaction record, merely write the master record to "newMaster.dat". When there is a transaction record but no corresponding master record, print the message "Unmatched transaction record for account number ..." (fill in the account number from the transaction record)

For example: Unmatched transaction record for account 900

image text in transcribed

Sample Files: Given files 1) oldMaster.dat 100 Alan Jones 00 Suzy Green 348.17 -14.22 -104.58 27.19 053564820 8052586912 8051200891 8057901237 00 Mike Rosern 00 Mary Smith Piamo Beach anta Varia 100 27.14 300 62.11 00 100.56 700 100.0 900 200.0 Generated files 1) sorted oldMaster.dat 100 Alan Jones 00 Maty Smith 00 Suzy Green 800 ike Rosen 348.17 27.19 -14.22 104.58 8051200891 053564820 8057901237 8052586912 Santa Mar Pismo Beach 2) newMaster.dat 100 Alan Jones 00 Maty Smith 00 Suzy Green 800 ike Rosen Unnatched transaction record for account 900 75.31 89.30 95.78 104.5 8051200891 053564820 8057901237 8052586912 Santa Mar Pismo Beach

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions