Question: C++ classes program 1. Class specification Box.h models a box. Include private data for length, width, and height. Include a default constructor setting box dimensions

C++ classes program

1. Class specification Box.h models a box. Include private data for length, width, and height. Include a default constructor setting box dimensions to 1 x 1 x 1, a parameterized constructor where the user passes in dimensions, a destructor, accessor and modifier functions for all data members, and area and volume functions. Be sure to include all PRE/POST comments.

2. Write Box.cpp. Be sure to include all PRE/POST comments.

3. Write an application which uses Box objects. The company sells snow globes which come in a 4 inch by 4 inch by 4 inch box. There are two shipping boxes, one is 16 x 12 x 4 inches and the other is 20 x 8 x 8 inches. For a number of orders, the company would like to know how many shipping boxes are required and the shipping costs where packing bubble material is $0.0023 per cubic inch and external plastic wrap is $0.0016 per square inch. Packing bubble material is only needed on a partially filled shipping box. Code should use three Box objects, one for the snow globe and one for each ship box. Class functions must be called when needed, for example, the volume function is needed to compute the cost of packing bubbles and the area function is needed to compute the cost of plastic wrap around the outside of the box. Code should be reusable; changes to size of the ship box or the cost of packing material should require only minor code change.

Input: The user will enter the number of snow globes to be shipped. The user can enter as many orders as desired using 0 as a sentinel.

Sample:

C++ classes program 1. Class specification Box.h models a box. Include private

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 Databases Questions!