Answered step by step
Verified Expert Solution
Question
1 Approved Answer
java You work for a company that has warehouses of items. The items are all packaged in boxes that are roughly the same size. //
java
You work for a company that has warehouses of items.
- The items are all packaged in boxes that are roughly the same size. // double box
- Each warehouse has some shelves in it. //Double shelve
- The shelves all hold the same number of boxes. // shelves == boxes
- a shelf will only contain one kind of item on it, and a warehouse will have at most one shelf storing a given kind of item.
- The constructor will be given the number of shelves and the number of items which are held per shelf.
- When the warehouse is constructed, the shelves are empty. The get methods will report back the shelf count and capacity that the warehouse was constructed with.
- Your warehouse object will have a method to receive a truckload.
- A truckload will have only one kind of item (represented by an item code number) as well as the number of boxes of that item.
- You will load as many boxes as you can of that item given the above rules and return the number of boxes left on the truck (not loaded).
- Your warehouse object will have a method to ship an item.
- The shipment request will contain the item code as well as the number of boxes requested.
- The warehouse will ship out as many as it can, up to the amount requested. Your method will return the number of boxes shipped of that item.
- Both the receive and ship methods will have to update the internal tracking of items as items are received and shipped out. Different warehouses operate independently of each other and can have similar or entirely different sets of items.
- Along with the shelfCount and shelfCapacity properties, you will need 1 or more additional private properties in your class to keep track of which item is stored at each shelf and how full each shelf is. It is up to you to decide how to do this. Any additional properties you add should be private, and should not have getters or setters.
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