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 1 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 q, init q, and mutator methods assign value 1 if passed non-positive 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 $0.0023 per cubic inch. Packing material is only needed on a partially filled shipping box. Plastic wrap around a sealed box costs $0.0008 per square inch. These values should be named constants.
Application:
A company sells snow globes in cubic boxes with choices of 444,666 or 888 dimensions in inches Two shipping boxes are available. The first has dimensions 668 inches and costs $5.50 and the second has dimensions 101212 inches and costs $6.75.
Input:
Use a sentinel-controlled 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 f 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.
Design a Box class stored in module box.py with

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!