Answered step by step
Verified Expert Solution
Question
1 Approved Answer
HW Assignment # 1 The XYZ Hardware Company has hired you to program its Accounts Receivable department. ( A / R are accounts that owe
HW Assignment #
The XYZ Hardware Company has hired you to program its Accounts Receivable department. AR are accounts that owe money to
the company for purchases from the company
There are two types of input data
A master file in ascending order by customer number, containing a digit customer number, a character customer name
and a balance due.
A transaction file containing records of each transaction by each customer. This file is in ascending order by customer
number. There should be more than one transaction record per master record. Each related group of data in a file is called a
record. A record should be stored in a structure.
There is also a input file which just contains a list of numbers from to details below
For the first input files. each record starts with a character, for order or for payment. Each also contains the fourdigit customer
number, a fourdigit transaction number, plus up to three more values:
If the code is O the record contains the item ordered characters the quantity ordered an integer plus the cost of the item.
You must multiply to get the total cost If the code is P the record contains the amount of the payment
From the file each time you are finished processing a customer you will read the next number in the file and that will be the
discount they will get when making the current payment. For example, if the payment is $ and the next number read in from the
file is a for this customer, they should get an additional off the balance, so a payment of $ will give them an additional
$ off their balance for a total credit of $
You are to read in records one at a time from the two files and use the transaction file records to update the master file balance.
Process all transaction records for each master record before going on to the next master record. If the transaction record contains an
O in column calculate the order amount and add it to the balance due. If the record contains a P in Column subtract the
payment from the balance due. Keep a running total of the Balance of ABC Company that is the sum of the balances due for
each customer
Your program should
Check for errors such as duplicate master records or records in the transaction file with a customer number that does not appear in the
master file.
After processing a master record and all its transaction records prepare an invoice for each customer which lists on top the customer
name and number, a line depicting the previous balance the original balance in the master record before any transactions followed by
the transactions and the a balance due.
It should look like this
Customer Name
Customer Number
Previous Balance $xxxxxxxxxxxx
transaction number
transaction number
transaction number
transaction number
$xxxxxxxxxxx
Don't forget payments reduce balances orders increase balances. You are to create your own data using at least to customers with
an average of to transactions each. Remember to create a file with at least as many numbers as the number of balance sheets
you are processing.
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