PROBLEM 1 Implement moveOneBox in Warehouse. The arguments are a Box and a numbe
ID: 3209919 • Letter: P
Question
PROBLEM 1
Implement moveOneBox in Warehouse. The arguments are a Box and a number of Shelf corresponding to the Shelf on which the Box sits. If there is a Shelf with a smaller height where the Box would fit, move the Box to the end of that new Shelf (and don't forget to update all the fields that need to be) Question 8. Implement reorganize in Warehouse. Start with the lower Shelf and the rst Box on this Shelf and go on until the last Box on the last Shelf. You can optimize this procedure, but this is the order we are looking for.
Explanation / Answer
Moving Boxes around.
Your warehouse is now fully functional : each day
you receive and ship boxes. But the placement of the boxes may become non
optimal. Let us see why on an example : there are two shelves with height
15 and 20 respectively and length 10 for both. You receive a rst box of
height 15 and length 10. You place it on the rst shelf (of height 15). You
now receive a second box of height 15 and length 10, so you place it on the
second shelf. And then you ship the rst box. So the rst shelf is empty and
the second shelf has the box of height 15. Now if you receive a third box of
height 16, you have to send it back saying sorry, no room left". But if you
had moved the second box on the rst shelf, you could have stored the third
box on the last shelf !
You are going to implement this reorganization of the warehouse, first for
a single box, then for the entire warehouse.
Implement moveOneBox in Warehouse. The arguments are a
Box and a number of Shelf corresponding to the Shelf on which the Box sits.
If there is a Shelf with a smaller height where the Box would t, move the
Box to the end of that new Shelf (and don't forget to update all the elds
that need to be)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.