Answered step by step
Verified Expert Solution
Question
1 Approved Answer
We can calculate the surface area of a rectangular box (rectangular prism) using the length, width, and height of the box and adding up the
We can calculate the surface area of a rectangular box (rectangular prism) using the length, width, and height of the box and adding up the area of each side. The surface areas of the three different possible sides are length*width, width*height, and height*length and each side appears twice, resulting in a surface area of 2hl+2lw+2wh. To be safe, we'll add a small "fudge factor" by adding the area of the smallest side to our total. For instance, for a gift box that's 10cm high, 20cm long, and 15cm deep, the surface area would be: (2*10*20) + (2*20*15) + (2*15*10) = 400 + 600 + 300 = 1300cm of wrapping paper. The smallest side in this case is w*h, so we'll add an extra 15*10 cm of paper (150cm) for a total of 1450cm of paper. Requirements Write a program to perform the following actions: 1. Print a banner for the program when it starts up. 2. Prompt the user to enter the dimensions of the box separated by x. (For instance, our box above would be entered as 10x20x15.) 3. Split the value entered into length, width, and height, in any order. 4. Calculate the surface area of the box
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