Posted by speedy11 on 18:34:00 02-13-2002
Hope you can help guys and gals.
Can any one send me some code for this question,,,just asking if you have a program or know where I can get one written in C not C++.
Found a few but no where near the question.
A small shopkeeper uses a simple computer system to keep an up to date inventory of
all products stocked. Every week the shopkeeper updates the stock file with a series of
stock amendments, stored on another file. The format of both TEXT FILES is shown
below, with each record stored in ascending order of product code, and each field being
separated by a comma. Both files tenninate with a special "sentinel" product code of
9999.
Stock File.
Product Code 4 digits
Quantity 4 digits (in the range 1000 to 9999)
Buying Price 4 digits
Sale Price 4 digits
Stock Amendments File.
Product Code 4 digits
Amendment Type 1 character 'I' for an issue from stock.
'R' for a receipt into stock.
'B' for an amendment to the buying price.
'S' for an amendment to the sale price.
'D' for a deletion of the stock item.
Value 4 digits
NOTE
The data item "Value" will be zero in the case of a stock item deletion.
Write a program that will update the existing stock file, creating a new stock file, in the
same order as the original. It is possible that a stock item will have one, more than one,
or no transactions during a week. After the update of a master record, any stock item
that is outside the given range should also have the record written to a "query file".
You can assume that there are no transactions in the stock amendments file that do not
have matching product codes in the stock file.
THANKS in advance.
[ This Message was edited by: speedy11 on 2002-02-13 18:36 ]
[ This Message was edited by: speedy11 on 2002-02-21 01:51 ]
[ This Message was edited by: speedy11 on 2002-02-27 19:00 ]