Question: Package Class Create a class named Package with variables for length, width, and height (use doubles). Assigning the values: You can either create a constructor

Package Class

Create a class named Package with variables for length, width, and height (use doubles).

Assigning the values:

You can either create a constructor with 3 parameters or you can use a public function to set them. To keep it simple, you do not have to get user input.

PackageSize

Create a public function named PackageSize that returns the package's size. Use UPS's formula: length + 2 * width + 2 * height. The tricky part is that the length should be the largest dimension. See UPS Package Size for more information. If you are struggling with calculating the longest side, just focus on creating the object.

Program

Create a program that creates 2 packages. For each, assign dimensions to the packages. Ask each package for its package size and display the values returned.

Upload your .cpp and .h files (you should have 3)

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!