Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is in C++. We need to create a class named box and demonstrate the requirements below: Box Class Mandatory Requirements: O Height, width, and

This is in C++. We need to create a class named box and demonstrate the requirements below:

image text in transcribed

Box Class Mandatory Requirements: O Height, width, and depth dimension attributes. Each of these dimensions is stored as a positive real number with a minimum possible value of 0.01. O Include a set (mutator) and get (accessor) method for each dimension. O Ifa dimension is set to a value lower than the minimum (0.01), then throw an invalid_argument exception with an appropriate message. O Default and parameterized constructor(s). If arguments are not specified when a box is instantiated, then each of the dimensions of the box should be set to 1.o. O A method to resize the box. This mutator should have three parameters; one for each of the dimensions. O A method to get the volume of the box. This accessor should return height x width x depth. O A method to convert the object to a string. This accessor should build a string that neatly displays the dimensions, formatted for output. Program Requirements: The purpose of the main() function in this program is to demonstrate each of the features of the Box class. There is no set expectation for how you should do this but it should be sensible and easy to decipher from looking at the program output. Things to Explore: You are welcome to explore beyond the mandatory requirements if you wish. Some suggestions you may be interested in include concepts that will be covered in later units: O Including static members in your class. Consider adding variables to store the minimum and maximum dimensions a box could have. These values would be shared by all Box objects. O Creating a derived class. Think of a new class that builds on the Box class. Alternatively, you could create a Rectangle class and derive the Box class from it. O Creating arrays/vectors of objects, or use a pointer to dynamically allocate objects. You could try this out in your demo program

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Infrastructure For Medical Research In Databases

Authors: Thomas Heinis ,Anastasia Ailamaki

1st Edition

1680833480, 978-1680833485

Students also viewed these Databases questions