Question
Written in Java Write a program to monitor the flow of an item into an out of a warehouse. The warehouse has numerous deliveries and
Written in Java
Write a program to monitor the flow of an item into an out of a warehouse. The warehouse has numerous deliveries and shipments for this item (a widget) during the time period covered. A shipment out (an order) is billed at a profit of 50% over the cost of the widget. Unfortunately each incoming shipment may have a different cost associated with it. The accountants of the firm have instituted a last-in, first out system for filling orders. This means that the newest widget are the first ones sent out to satisfy an order. This method of inventory can be represented by a stack. The Push procedure will insert an incoming shipment while a Pop should be called for a shipment out. Each data record in the text file warehouse.txt will consist of one shipment per line with fields (separated by white space of)
I or O (char) shipment coming IN or shipment going OUT
# (integer) quantity of the shipment
Cost (float) cost per widget of the shipment (Incoming only)
Vendor (String) name of the company sending or receiving the shipment
Write the necessary procedures to store the shipments received and to process the orders. The output for an order consists of the quantity and the total costs of the widget in the order. Each widget price is 50% higher than its cost. The widgets used to fill an order may come from multiple shipments with different costs. If there are not sufficient widgets in inventory, use all the remaining and bill accordingly.
When the simulation terminates display the total amount owed to each of the suppliers (incoming), the number of widgets on hand and the total profit.
The total profit is the difference between the total shipment prices from the cost of the shipments. It ignores the unsold inventory still in the warehouse.
Sample Input:
I 20 34.00 Freds Supply Company
I 30 25.00 Jumbo Exports
O 40 Acme Industries
Output:
Orders:
Shipment to Acme Industries 40 units for $1635.00
Summary:
Suppliers
Freds Supply Company $680.00
Jumbo Exports $750.00
There are 10 widgets in the warehouse.
Profit is $545.00
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started