See the assignment turn-in page for instructions on turning in your assignment.
The distribution center keeps information about cheeses on hand in a text file called the inventory file. Each line in an inventory file has the following form
where
Each field is separated from the next by at least one, and possibly more, space character, and each line ends in a newline. Lines appear in an inventory file in no particular order. Here is an example inventory file:
25 15 10 stilton 100 100 50 limberger 50 30 40 goat
You may assume an inventory file never contains more than 25 lines.
All the shoppes' sales receipts are aggregated into a text file called the sales file. Each line in a sales file has the following form
where
Each field is separated from the next by at least one, and possibly more, space character, and each line ends in a newline. Lines appear in a sales file in no particular order. Here is an example sales file:
store10 3 swiss store10 5 brie storeCN01 10 monterey jack
inventory.dat
and the sales file sales.dat
and
adjusts the amount of cheese on hand by the daily sales.
When both files have been read and processed, the program writes an inventory
file called new-inventory.dat
and an reorder file called
reorders.dat
. new-inventory.dat
contains the new amounts-on-hand
after processing the daily sales; reorders.dat
contains the amounts and
types of cheeses the distribution center should order to replenish its stocks.
A reorder file is a text file in which each line in the file has the form
where
The fields are separated by at least one, and possibly more, space character, and each line ends in a newline. Lines in a reorder file appear in any order.
Processing proceeds according to these rules:
inventory-1.dat
, sales-1.dat
, new-inventory-1.dat
, and
reorders-1.dat
inventory-2.dat
, sales-2.dat
, new-inventory-2.dat
, and
reorders-2.dat
Note that you will have to rename the input files to use them with your program. You can download these files from a browser (shift-left-click on the link) or access them directly at
/export/home/us/csfac/cs176-summer2001/pa/5
from any PC lab machine running linux or rockhopper.
This page last modified on 18 July 2001.