IUP Computer Science
COSC 310    Fall 2007

Project #2
(More Revenue)
(Due  26 Sep 07)

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

The total cost of a resale item for the company is the base cost plus the shipping.  The sales price of a resale item is the total cost times the resale markup (currently set at 127%).  resale.dat can be found on the I: drive, in  I:\jlwolfe\310\f07

Wood Stuff Inc. also sells some of its own products as reconditioned.  These are the only products it sells to the retail market.  Specifications are held in the file used.dat; this is a binary file in Little Endian format, also on the I: drive.  Each reconditioned product appears in the file as follows:

Model Number as a short  (This is based on the original product number;
   a 1 is added to the front.  For example, the heavy cupboard is sold originally
   as model 5322 and sold used as model 15322.)
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
Cost, indicating what Wood Stuff Inc. paid to buy it back,  as a float
Condition rating as a short  (1 best quality, 2 average quality, 3 poor quality)

The retail sale price for a reconditioned product is based on the original wholesale sale price and the condition rating; the retail sale price is the original sale price times a factor based on condition.  Condition 1's factor is 75%; condition 2's factor is 50%; condition 3's factor is 33%.

You are to add to the program for Project #1, classes and methods to include the resale products and used products.  Your program must do this through inheritance - have a Product super class and three subclasses for the three categories of products sold.  A more inclusive set of customer orders are provided in the file orders2.txt on the I: drive.  For Project #2,  you are again required to display a projection of revenue based on the outstanding orders in orders2.txt, similar to what was done in Project#1, without the total at the end.  This display 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.

Customer                           Orders    Total Due
Trader Horn                             3   $  4647.97
Ace Hardware                            4   $ 10228.23
Renningers                              3   $  1994.62

Using a Product superclass and three 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 (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 the first six products of each type and their sale prices, based on my calculations of them.  The complete list of sale prices can be found in the file  prices.txt   which in at  I:\jlwolfe\310\f07

 5149  oak storage unit                     65.09
 5150  deluxe oak unit                      75.45
 5151  maple storage unit                   65.44
 5152  deluxe maple unit                    75.92
 5153  walnut storage unit                  69.90
 5211  4-shelf bookcase                    123.01

 7011  Kitchen-table                        62.55
 7013  Maple-table                          76.84
 7014  Oak-table                            73.91
 7015  Walnut-table                         90.68
 7022  End-table                            54.74
 7023  End-table                            46.16

15320  cupboard-w/-brass                   140.39
15321  cupboard-std                         86.76
15322  heavy-cupboard                      127.64
15561  basic-entertainment                 110.67
15563  walnut-entertainment-w/-drawers     117.20
15564  maple-entertainment-w/-drawers       73.35

Your sale prices may differ from these by a cent or two depending on how you calculated them.  Any greater difference indicates an error.