Перевод текста HW Assignment IH
! ! ! ! !
ЦЕНЫ НА РАБОТЫ ДЕМПИНГОВЫЕ (НИЖЕ РЫНОЧНЫХ)
РАССМОТРЮ ВАШИ ВАРИАНТЫ ПО СТОИМОСТИ РАБОТЫ
ЕСЛИ РАБОТА ЗАИНТЕРЕСОВАЛА, ПИШИТЕ В ЛИЧКУ, ДАВ ССЫЛКУ НА НЕЁ.
HW Assignment IH
The ABC Hardware Company has hired you to program its Accounts Receivable department. (AIR are accounts that owe money to the company
for purchases from the company) There are two types of input data 1. A master file in ascending order by customer number, containing a 4-digit customer number, a 20-character customer name and a balance due.
2. 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. Each record starts with a character, 0 for order orP for payment. Each also contains the four-digit customer number, a four-digit transaction number, plus up to three more values:
If the code is "0", the record contains the item ordered (20 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. 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. Process all transaction
records for each master record before going on to the next master record.
If the transaction record contains an "0" in column 1 calculate the order amount and add it to the balance due. If the record contains a "P" in Column 1 subtract the payment from the balance due. Keep ,a running total of the
, AIR 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 an 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 $xxxxxxxxxx.xx
transaction number
transaction number
transaction number
transaction number
item ordered
item ordered
payment
item ordered
order amount
order amount
payment amount
order amount
Balance Due $:xxxxxxxxx.xx
Don't forget payments reduce balances orders increase balances. You are to
create your own data-using at least 7 to 10 customers with an average of 4 to
5 transactions each.
--.--.--~"------.--.. -.- ..-.-.
f I- 'J ----------- .-.--_._-
This program assumes that a company has warehouses in 5 cities:
New York, Los Angeles, _Miami, Houston and Chicago. In each warehouse the
company stocks three items. A record contains the amount of each itern
currently in each warehouse.
The record should contairi'an array of 5 warehouses with the name
of each 0arehouse and an array of the 3 itmes~ith the amount that is
currently in stock in the warehouse.
Initially the warehouses are empty. Read in a card containing the
three prices of the- three items. Then read in cards which may be anyone of
two types:
1. Shipment cards containing
S city amt1 amt2 amt3
which represents a shipment to a given city of amtl of item1
amt2 of it~e2 and amt3 of item3.
2. Order cards containing
o city amtl
which represents an order in
the various items;
amt2 amt3
a given city of the respective amounts of
As each shipment card is read in, print it out, update the amounts in that warehouse and then print on the next line: city amtl amt2 amt3
As each order card is read- in, print it out. If there is e.nough in stock at that_warehouse of each item, update the amounts._ If th~re is not enough,
seardh the other warehouses for the one which has the most of that
particular item, ship the amount needed from one warehous~ to the other
printing out: .
x of item y shipped from cityl to city2
and
city1 amtl amt2 amt3
10% extra is to be charged for any item shipped from one city to another.
If no single warehouse has enough extra -to fill the order for a particular
item print out:
Order unfilled
However any shipments of previous items remain in effect.
In either case print out the adjusted
city amt1 amt2 amt3
If the order is filled print
Price of Order: Price ...........