Project #2
(More Inventory Control)
(Due 13 Feb 08)
In addition to the products that it makes, Wood Stuff Inc. sells a few products that it acquires from other sources. Specifications for these products are held in the file resale.dat This is a binary file in Little Endian format. Each resale product appears in the file as follows:
Model Number for the product
as a short
Description Length indicating the number
of characters in the description as a byte
Description of the product, one byte per
character of the description
Number On Hand indicating how many are
in stock as a short
Supplier Length indicating the number
of characters in the supplier name as a byte
Supplier of the product, one byte per
character of the description
Base cost, indicating what Wood Stuff
Inc. paid for the product, as a float
Shipping cost for the product as
a float
resale.dat can be found on the I: drive, in I:\jlwolfe\310\s08
You are to add to the program for Project #1, classes and methods to include the resale products. Your program must do this through inheritance - have a Product super class and two subclasses for the two categories of products sold. A more inclusive set of customer orders are provided in the file orders2.txt on the I: drive; it contains orders for products created by WSI, as well as orders for some of the resale products. For Project #2, you are again required to display a report of inventory items that need to be ordered to fulfill the current orders; however, you are also required to display a report of resale items that need to be ordered to fulfill the current orders. The resale report is required to appear in a JFrame window as a JTable, not on the console output. The first few lines should look like this, but in table form in a window.
Resale Product
OnHand Needed Purchase Cost
Remaining
Kitchen-table
8 8
6 295.50
Maple-table
12 0
0
12
Oak-table
22 27
11 640.20
The report shows for each resale product the number on hand, the number needed to fill the orders and the number that need to be purchased to fill the order. If more resale products need to be purchased to fill the order, the cost of the purchase is shown; if no purchase is necessary, the report shows the number of the product that will remain on hand after filling the orders. The rule for purchasing is that if the number remaining would be less than 3, the number to purchase is whatever is needed to fill the orders and leave 6 on hand. If the number remaining will be 3 or more, the number to purchase is zero. These rules are the same for all resale products.
Using a Product superclass and two subclasses should facilitate keeping track of all products under one umbrella through inheritance and should allow you to use polymorphism to implement some of the methods for the subclasses. If you have designed project #1 in a reasonable way, you should be able to copy many of the classes unchanged into project #2.
Hand in a printout of your well-documented program, and a printout of the product revenue display for resale products (captured from the screen). You must create a folder named p2 under the folder named after you on the P: drive for COSC 310. Copy into p2 all .java files that you created for this project (including the ones from Project #1 that stayed the same).
Following is a listing of a text version of the resale.dat file. This is provided so that you can be sure you understand what the resale products are and what their quantity on hand is. resale.dat is NOT in this form; it is a binary file.
7011 Kitchen-table 8 84-Lumber 41.75 7.50
7013 Maple-table 12 Wholesale-Furniture 52.40 8.10
7014 Oak-table 22 Wholesale-Furniture 49.30 8.90
7015 Walnut-table 6 Wholesale-Furniture 62.50 8.90
7022 End-table 12 Brick-a-Brack 37.50 5.60
7023 End-table 30 84-Lumber 29.50 6.85
7024 End-table 36 Wholesale-Furniture 34.95 5.25
7033 Card-table 10 Wolf's 23.35 5.40
7041 Display-table 40 Brick-a-Brack 35.80 5.55
7050 Hall-table 15 Wolf's 28.40 5.10
7052 Table-extension 5 Murphys 18.50 4.98
7055 Table-carrier 4 Murphys 19.50 3.75
7113 Maple-chair 52 Wholesale-Furniture 33.75 4.75
7114 Oak-chair 48 Wholesale-Furniture 30.50 5.00
7115 Walnut-chair 30 Wholesale-Furniture 41.40 5.00
7233 Drawer 15 Murphys 12.30 3.50
7250 Sconce 19 Wolf's 23.00 3.50
7366 Workbench 12 84-Lumber 44.75 7.80