Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN JAVA Your program should do the following: Prompt the user for the size of the box (height, width, length) in inches. For example, a
IN JAVA
1. Problem Statement: The goal of this programming assignment is to give students experience with input/output commands and basic numerical calculations in Java. In particular, your task is to calculate how many boxes of the same size can be placed inside a truck for shipping. Your program should do the following: - Prompt the user for the size of the box (height, width, length) in inches. For example, a common box size is 15 by 16 by 22. - Prompt the user for the interior size of the truck (height, width, length) in feet. For example, a typical truck size is 8 ' by 7 ' by 20. - Calculate and print the number of boxes of this size will fit into the truck when the (height, width, length) orientation of the box is aligned with the (height, width, length) orientation of the truck. - Calculate and print how much empty space there is in the truck all three directions (height, width, length) after the boxes are put in the truck. - Calculate and print the space utilization of the truck (the percentage of available space filled by the boxes). For example, with the box and truck sizes given above, we achieve 81.8% truck space utilization. - Repeat the three calculations above (number of boxes, empty space and space utilization) and print the results when the boxes are rotated 90 degrees so the box length is aligned with the truck width, and the box width is aligned with the truck length. 2. Design: Your first design task is to decide how you want to do the program input/output. What messages you want to print, how to read inputs, how to write outputs. There is no "right way" or "wrong way" to do this but you want your program to be easy to use, and the outputs to be easy to understand Your program should do the following: Prompt the user for the size of the box (height, width, length) in inches. For example, a common box size is 15" by 16" by 22".
Prompt the user for the interior size of the truck (height, width, length) in feet. For example, a typical truck size is 8' by 7' by 20'.
Calculate and print the number of boxes of this size will fit into the truck when the (height, width, length) orientation of the box is aligned with the (height, width, length) orientation of the truck. D Calculate and print how much empty space there is in the truck all three directions (height, width, length) after the boxes are put in the truck. Calculate and print the space utilization of the truck (the percentage of available space filled by the boxes). For example, with the box and truck sizes given above, we achieve 81.8% truck space utilization.
Repeat the three calculations above (number of boxes, empty space and space utilization) and print the results when the boxes are rotated 90 degrees so the box length is aligned with the truck width, and the box width is aligned with the truck length.
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