Question: Write a program to calculate the cost to wrap a present Make a Box class It should have 3 properties length, width, and height Write
Write a program to calculate the cost to wrap a present
Make a Box class
It should have properties length, width, and height
Write a constructor, init It can have defaults of for length, width, and height
Write a str function to create a string, length x width x height where each value is printed to two decimal places
Write a function to calculate and return the surface area, which is LW WH LH
Prompt the user for the length, width, and height of the present box in inches
Set those values in a Box object
It costs $ per square inch to wrap a present
Print the dimensions of the Box using str and then the cost of the wrapping
Sample Run #bold underlined text is what the user types:
Length?
Width?
Height?
Cost for x x is $
Note: This is an introductory level class with this problem beginning to cover classes. There is a sample output of what the program is supposed to look like when it is runned.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
