Question
In Java, this program has been very difficulit.: A shipping carton has five fixed compartments, each measuring 12 long by 6 wide by 8 high
In Java, this program has been very difficulit.: A shipping carton has five fixed compartments, each measuring 12 long by 6 wide by 8 high (inside dimensions). The carton weighs 2 pounds when it is empty. The following items were given to a packing robot to pack into the shipping carton: Item 1: 10 L, 4 W, 8 H, weight=5 lb. Item 2: 11 L, 5 W, 7 H, weight=6 lb. Item 3: 13 L, 4 W, 6 H, weight=4.5 lb. Item 4: 9 L, 4 W, 9 H, weight=6.5 lb. Item 5: 12 L, 6 W, 8 H, weight=4.8 lb. Item 6: 10 L, 4 W, 8 H, weight=7 lb. Item 7: 10 L, 4 W, 8 H, weight=7 lb. Item 8: 10 L, 4 W, 8 H, weight=5 lb. The robot will make sure each item fits before it is packed and set it aside if does not fit. If the shipping carton is full, the item will be set aside. Print a report showing how many items were packed and the total weight of the container. Getting started: class PackedItem { static final double LENGTH_LIMIT = 12; static final double WIDTH_LIMIT = 6; static final double HEIGHT_LIMIT = 8; static final int NUMBER_OF_COMPARTMENTS = 5; private static int numberPacked = 0; private static double totalWeight = 2; } Sample output: Item not packed: Too Big Item not packed: Too Big Item not packed: Carton Full Number of items packed = 5 / Total Weight = 31.8 pounds
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