Project #2
(More Assets)
(Due 14 Feb 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
Whatever quantity Wood Stuff Inc. has on hand for each of the resale items adds to the company's assets. 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
You are to add to the program for Project #1, classes and methods to include the resale products in the product asset list overall. That is, the assets report should show the value of the products manufactured at Wood Stuff Inc., as well as the products it resells.
You are also to add to the program a GUI interface to allow the person at the keyboard to select one of three asset report actions. This should be done with the JOptionPane class. Allow the choice of actions using buttons. The actions are: Display the Product Assets (including both categories of products) in the same format at in Project #1, Display the Inventory Assets in the same format as in Project #1, Write the Product assets to a binary file. You should already have the methods to do the first two actions (after modifying the products to handle resales). For the third action, your program must use a dialog box to obtain the name of the file to write.
The binary file your program writes must contain the following information about each product in the format specified and the file must be in Big Endian form overall.
Model Number of 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
Quantity on Hand as a short
Sale Price of the product as a float
Asset Value of all of this product on
hand as a float
Suggestion: Assuming that you made a "Product" class for Project #1, restructure your class slightly to create a Product superclass with two subclasses, one for manufactured products and one for products being resold. Doing this 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.
Hand in a printout of your well-documented
program, and a printout of the product assets display (captured from
the console window). 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). Also, copy to
p2 the binary file which your program writes for the third action.
You should name this file after yourself; for example, I might name mine
wolfeproducts.dat