Question: Design a Box class stored in module box.py with data attributes for integer length, width, and height, method with default values of 1 for each
Design a Box class stored in module
box.py with data attributes for integer length, width, and height, method with default values of for each data attribute, accessor and mutators methods for each data attribute, string representation methods and method where boxes are considered the same with equal dimensions and methods for surface area sum of areas of the six rectangular sides and volume length times height times width Include comments on methods. The init and mutator methods assign value if passed nonpositive values.
Note you are writing a general purpose Box class that can be used in any application that needs a box. Not all methods might be called in this particular application.
Test your Box class prior to starting the application.
Write a main application that uses Box objects to model a snow globe box and a shipping box. Packing material costs $ per cubic inch. Packing material is only needed on a partially filled shipping box. Plastic wrap around a sealed box costs $ per square inch. These values should be named constants.
Application:
A company sells snow globes in cubic boxes with choices of or dimensions in inches Two shipping boxes are available. The first has dimensions inches and costs $ and the second has dimensions inches and costs $
Input:
Use a sentinelcontrolled loop to process a snow globe order until the user wishes to quit. Create a Box object and add to a list of Box objects. Use a data validation loop to ensure a valid now globe dimension.
Processing:
For each order in the list, compute costs packing the snow globe in the best fit shipping box. Report dimensions and costs for ship box, packing material, and plastic wrap in a neat chart using f strings for column width and money amounts with $ and two decimals. See sample output for report design.
Under the report display counts of each type of snow globe in a neatly formatted chart using strings to make column widths.
Required Code:
The main method is used.
Code must make use of a Box object for the snow globe box. Once the Box object is declared, only Box methods may be used.
Code must make use of a Box object for the shipping box. Once the Box object is declared, only Box methods may be used.
Infinite while True: loops with jump statements such as break or continue are not permitted.
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
