You have been hired to maintain and produce an accounting report for charges and payments for a local retail store. You are to set up a record for each costumer with there current balance. You are to read in the charges and/or payments that each customer makes against his account. The customer and charge/payment data will be found in files.
The costumes data file format is as follows:
a. An account number: 6 digit positive number
b. Name and address of the customer: up to 50 chars.
c. Current balance: a positive number for debits (if the customer owes money to the store), a negative number for credits (the stores owes money to customer.
For each purchase made by a customer a "charge card" has the following fields:
a. the account number
b. the word CHARGE
c the amount of purchase, a positive number.
For each payment made by a customer a "payment card" has the following fields:
a. the account number
b. the word PAYMENT
c. the amount paid, a positive number
Using the charge data and payment data and the customer file, write a program to
a. print out a monthly statement for each customer
b. print the updated customer file.
Note that for each customer there could be no charge data or payment data or there could be one or more charge data or payment data for a given customer.
The monthly statement for each customer should show the
a. account number
b. the name and address
c. all payments
d. all charges
e. previous balance
f. new balance
Include in the charges a 2.3% interest and handling fee based on the balance in the customer file, if the balance is positive. Else, a flat $7.00 charge otherwise. You may assume there are no more the 30 customers and for each customer there will be no more than 15 charges and no more than 10 payments for a given month.
Input files: Customer.txt
631502 Legg T. 2839 Lionel Ave. +16.30
180003 Hofstra M. 225 Smith Str -6.00
000963 Malioneyh P. J. 4344 Nero Rd +366.92
517724 Morier G. E. 19 Cumberland Ave +60.40
432649 Hauser M. 2940 Toronto Rd 0.00
817387 Currie W. D. 281 Harvard Str +55.00
913478 Hoos R. Dadie 821 County Road -100.00
713422 Smelly Tau 7281 Tobe Cir 0.00