Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Java Expert


Home >> Java

Warehouse Inventories

Objective:

Work with multiple objects and review reading data files.

Description: A wholesale distributor has six warehouses (Atlanta, Baltimore, Chicago, Denver, Ely and Fargo) and sells five different items (identified by part number: 102, 215, 410, 525 and 711). Each warehouse may stock any or all of the five items. The company buys and sells these items constantly. Company transaction records contain a transaction code (‘P' for a purchase or ‘S' for a sale) followed by an item number and the quantity (bought or sold).

The transaction records are contained in a transaction data file named Transactions.txt.

Sample transaction records: Transactions.txt
P 410 1000
S 215 120
S 711 300

A separate data file contains the initial status of the six warehouses at the beginning of the day (i.e., the ending status from the night before). This data file has only six records (lines). Each record (line) contains five numbers that show the quantity on hand for the five items in that warehouse. This file is named Inventory.txt.

Sample status data file: Inventory.txt
500 120 60 0 350
100 230 0 50 0
0 75 0 0 220
600 50 120 300 40
210 160 30 80 50
90 50 90 200 70

The status data file is updated by processing the transaction records in the transaction data file according to these rules:

1 - For a sale (‘S') - subtract the quantity sold from the warehouse that has the largest supply of that item on hand.

2 - For a purchase (‘P') - add the quantity purchased to the warehouse that has the lowest supply of that item on hand.

Instructions:

Write an object-oriented Java program to do the above inventory warehouse processing. Each of the six warehouses should be treated as an individual object. For example, Atlanta would be an object with each of the five part numbers as instance fields. Each of the other warehouses should also be objects with the five part numbers as instance fields. Of course, there would be one class which would be the main (driver) class from which these 6 objects would be created.

In the beginning of the program, the status data file (Inventory.txt) should be read and an object for each warehouse created. The Inventory.txt data file is in the following order: the first line is the Atlanta warehouse, the second line is the Baltimore warehouse, third Chicago, then Denver, Ely and Fargo. After the objects are created, the transactions data file (Transactions.txt) are read and processed.

The objects should be updated as the transaction records are read and processed.

The program should:

1 - Display the initial (beginning-of-day) status for all warehouses.

2 - Process each transaction from the transaction data file and show which warehouse's inventory was updated to reflect that transaction.

3 - Display the final (end-of-day) status for all warehouses.

Requirements:

- The class must be named Inventory.
- The main program (driver) must be named Warehouses.
- A driver (main class) as well as a programmer-defined class must be used.
- Submit program through the assignment tool in Moodle2.
- Include a comment stating your name.
- Each student must create his/her own independent program.

Java, Programming

  • Category:- Java
  • Reference No.:- M92022127
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Java

Chatbotscreate a small networked chat application that is

Chatbots Create a small, networked chat application that is populated by bots. Introduction On an old server park, filled with applications from the early days of the internet, a few servers still run one of the earliest ...

Retail price calculatorwrite a java program that asks the

Retail Price Calculator Write a JAVA program that asks the user to enter an item's wholesale cost and its markup percentage. It should then display the item's retail price. For example: (If an item's wholesale cost is 5. ...

Question slideshows or carousels are very popular in

Question : Slideshows (or carousels) are very popular in websites. They allow web developers to display news or images on the website in limited space. In this code challenge, you are required to complete the JavaScript ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Applied software engineering assignment 1 -learning

Applied Software Engineering Assignment 1 - Learning outcomes - 1. Understand the notion of software engineering and why it is important. 2. Analyse the risk factors associated with phases of the software development lif ...

Assignment - method in our madnessthe emphasis for this

Assignment - "Method in our Madness" The emphasis for this assignment is methods with parameters. In preparation for this assignment, create a folder called Assign_3 for the DrJava projects for the assignment. A Cityscap ...

Overviewyou are required to use java se 80 and javafx to

Overview You are required to use Java SE 8.0 and JavaFX to develop a Graphical User Interface (GUI) for the FlexiRent rental property management program created in Assignment 1. This assignment is designed to help you: 1 ...

Assessment socket programmingtaskwrite a java gui program

Assessment: Socket Programming Task Write a JAVA GUI program that would facilitate text chatting/exchanging between two or multiple computers over the network/internet, using the concept of JAVA socket programming. If yo ...

In ruby the hash class inherits from enumerable suggesting

In Ruby, the Hash class inherits from Enumerable, suggesting to a programmer that Hashes are collections. In Java, however, the Map classes are not part of the JCF (Java Collections Framework). For each language, provide ...

Can someone help me please with those question1what is the

Can someone help me please with those question 1:what is the best data type for student id datatime,currency,number,decimal 2:which relationshipis preferable? one to one,one to many,many to many 3:if you add table A's pr ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As