Small Town Hardware Assignment

advertisement
CIS 20
Solano College
Mr. Anderson
SmallTown
Processing Binary Data
This assignment is due: Thursday October 6. 2011
Refer to the Small Town Hardware Store TOOLS database on drive
H:\kanderso\CIS 20\tools.txt. Write a program that will list (to a file) only
those items in the TOOL file that should be ordered. These are items where
the sum of the quantity on hand and quantity on order is less than or equal
to the minimum quantity. All arithmetic should be done in binary.
The report should appear as follows (headings are not necessary and are
here only to show what fields to include):
ToolID
Description
QOH
QOO
____
SUM
____
MIN
___
___________________________
____
____
XXX
XXXXXXXXXXXXXXXXXXX
XXX
XXX
XXX
XXX
XXX
XXXXXXXXXXXXXXXXXXX
XXX
XXX
XXX
XXX
XXX
XXXXXXXXXXXXXXXXXXX
XXX
XXX
XXX
XXX
QOH = Quantity on hand, QOO = quantity on order, SUM is the total of QOH and QOO, and
if SUM is less than or equal to MIN, reorder. Tools database is a text file.
The TOOLS database input file contains the following fields (starting columns are listed
below the field, and two examples are shown):
Tool
-ID
Col 1
H4
PLM
Tool Description
Col 5
HAMMER 4OZ
PLIERS MED
Cost
Sell
QOH
MIN
EOQ
QOO
Col 30
4.20
5.40
Col 35
6.99
9.99
Col 40
5
4
Col 45
4
4
Col 45
3
6
Col 50
0
0
CIS 20
Solano College
Mr. Anderson
Part#2: Modify the above file so that a new TOOLS file is created with the
quantity on order field updated for those items that need to be ordered (be
sure to back up your original data file). The new quantity on order should be
equal to the old quantity on order plus the economic order quantity. Use
DDNAME=’NEWTOOL1.DAT’ in the DCB for this new file. All tools should be
written to this new file, even those for which there was no new order placed.
All arithmetic should be done in binary.
Part#3: Write a separate program that will convert the numeric fields in the
TOOL file to binary. All count fields should be stored as halfwords. All dollarand-cent fields should be stored as fullwords. The output file should be in
EBCDIC form. Call your file TOOL.BIN. [Note: You may need to reorder the
fields within the record, or add unused fields (fillers), so as to guarantee that
the fullwords and halfwords can be appropriately aligned. Again, any
arithmetic should be done in binary.
What to turn in for grading?
Part#1: output file and .mlc file and screen capture.
Part#2: .mlc file and output file from part#1 or screen capture, and
NEWTOOL1.
Part#3: TOOL.BIN and .mlc file
Download