Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You have been asked to produce a report showing the inventory of products at various warehouses owned by your company using Java. You will need

You have been asked to produce a report showing the inventory of products at various warehouses owned by your company using Java. You will need to create three classes: Prog7, Warehouse, and Part. The report will use two files: parts.txt and warehouse.txt with the formats shown below.

warehouse.txt file: text file with the following fields separated by spaces:

Fields

Description

Warehouse ID

3 characters

City

maximum 20 characters

State

2 characters

parts.txt file: CSV (comma separated value) text file in which each line in the file represents a warehouse. The comma delimited fields are:

Fields

Description

Part Number

5 characters

Description

maximum 30 characters

Price

double

Warehouse ID

3 characters

Quantity

Integer, quantity at this warehouse

Using these files, the program will output a summary report listing the parts in each warehouse and the total number of parts in each warehouse. Note that the parts are to be sorted by price. A sample output is as follows:

PGH Pittsburgh, PA

Total Number of Parts: 511

Part# Description Price Quantity

24680 Smoke Shifter 0.98 48

01020 Inflatable Dart Board 32.95 453

00000 Glass Hammer 105.90 8

12345 Left-Handed Bacon Stretcher 125.95 2

ATL Atlanta, GA

Total Number of Parts: 266

Part# Description Price Quantity

86420 Pre-dug Post Hole 2.49 34

25632 Acme Widget 98.29 248

12345 Left-Handed Bacon Stretcher 125.95 15

97531 Anti-Gravity Turbine 895.29 3

When developing a large, multiple-class program, it is advisable to test each class before proceeding. The following sequence is recommended for this assignment:

1. Develop Java classes for Warehouse and Part. Test each class separately to ensure the methods work correctly.

2. Begin the test program by reading each file into an array of the corresponding objects. Display each the contents of each array to verify that the objects are correctly filled in the arrays.

3. Complete the test program named Prog7 by adding the code to produce the report.

The user is not required to provide any input.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago