IUP Computer Science
COSC 310   Fall 2007

Project #1
(Customer Revenue)
(Due  5 Sep 07   and   14 Sep 07)

Wood Stuff Inc. sells wood furniture accessories (shelves, bookcases, entertainment centers, cupboards, etc.), usually wholesale to low-cost housing contractors and commercial outlets.  It is a small business with a very limited inventory of parts and a small stock of products on hand.  The company accountant wants to get a projection of revenue by determining how much all outstanding orders are worth to the company.

The component inventory listing is held in the file, inventory.txt.  Each line of this file contains the specification for one of the parts used in one or more of Wood Stuff Inc.'s products.  There are fewer than 100 different parts.  The specifications have colons separating each field (data item) from the next and are in the following form:

Part-No:Description:Supplier:Cost-per-part:Quantity-on-hand:Minimum-quantity-allowed

Here are the first few components to give you an example.  The part number is a 5-digit number; the description may contain several words; the supplier is a company name; the cost per part is measured in dollars and cents and is used to determine the cost and price of products WSI makes; the quantity on hand and the minimum quantity allowed are integers.  The last value represents the point at which more parts need to be ordered - when the quantity on hand dips below it.

10244:felt bumper pads:Soft Stuff Inc.:0.02:8510:2500
10398:screw covers:Soft Stuff Inc.:0.01:4535:3000
18560:3/4" cam bolt:Acme Co.:0.14:2430:500

The stock listing is held in the file, products.txt.  Each line of this file contains specifications about the parts which go into one product.  There are fewer than 100 products.  The specifications have colons separating each field (data item) from the next as follows:

Model-No:Description:Quantity-on-hand:Aggregate-labor:needed:part-no:needed:part-no: . . .

Here are a couple of examples of products.  The model number is a 4-digit number; the description may contain several words; the quantity on hand is an integer; the aggregate labor is often a floating point number; the "needed" for a part may be an integer or floating point number; the part-no is a 5-digit number that refers to a part in the inventory file.  The aggregate labor is the number of collective work hours required to produce the product.  The product may have any number of needed:part-no pairs to specify the components of the product.

5406:maple shelves:48:1.6:0.5:36701:0.5:36720:2:33124:18:40805:12:40802:1:22204
5408:oak shelves:37:1.5:0.5:36702:0.5:36712:24:41092:24:10398:1:22204
5440:plain shelves:52:1.4:1:36702:24:38023:1:22204

Based on the component parts, you program should be able to determine the cost to the company to make each product and the sales price at which the product is to be sold.  The sales price for a product is calculated from the sum of three elements:  cost of materials, cost of labor, and cost of packaging.  The cost of materials is the sum of the cost per part times the number of parts used for each part used to make the product.  The cost of labor is the number of aggregate work hours times the standard cost per hour (currently set at $12.33).  The cost of packaging is a standard percentage (currently set at 4%) of the cost of the materials.  The sales price is the sum of the three costs multiplied by the markup (currently set at 155%).  Here are a few prices to illustrate.

Model   Description                          Price
 5406   maple shelves                      $ 52.98
 5408   oak shelves                        $ 51.69
 5440   plain shelves                      $ 43.38

Customer orders are collected in the file named   orders2.txt  Each line of it has the form

Customer-Name:Model-No-Ordered:Quantity-Ordered

The orders for each customer are together.  That is, if a customer orders three products, those three orders are in consecutive positions in the file.  Here are the first few lines of the file to illustrate

Trader Horn:5211:15
Trader Horn:5149:10
Trader Horn:5212:15
Ace Hardware:5322:10
Ace Hardware:5571:20

These are all of Trader Horn's orders and the beginning of the orders from Ace Hardware.

You are to write a program that reads the three files and produces a revenue report showing how much each customer will be billed and the total amount to be billed to all customers.  Copy the three data files from   I:\jlwolfe\310\f07

You are required to do this project in two stages.

In the first stage, you must hand in a UML class diagram showing how you intend to construct the program.  The class diagram must conform to the description given in class and the UML handout and show each class you intend to use, its instance variables and methods.  It must also show the associations between the classes needed to perform the task.  The UML diagram is due on  5 Sep 07.

In the second stage, you must hand in a printout of your well documented program and the output that it generates (the revenue report).  You must create a folder named p1 under the folder named after you on the P: drive for COSC 310.  Copy into the p1 folder all .java files that you created for this project.  If you have placed the .java files in a package, copy the entire package to the p1 folder.  The program is due on 14 Sep 07.

Note:  The files and the classes that you design for this project are used in project #2.  So, you should construct your design and program so that additional tasks can be added to it.