Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You will create a new class called Box, which represents a rectangular cubiodh shape, and demonstrate its use. Box Class Mandatory Requirements: Height, width, and
You will create a new class called Box, which represents a rectangular cubiodh shape, and demonstrate its use. Box Class Mandatory Requirements: 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. Include a set (mutator) and get accessor) method for each dimension. If a dimension is set to a value lower than the minimum (0.01), then throw an invalid argument exception with an appropriate message. 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.0. A method to resize the box. This mutator should have three parameters; one for each of the dimensions. A method to get the volume of the box. This accessor should return height x width x depth. 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. /** Testring Method for Box class * Converts the obj to a string. @return the obj state as a string string Box:: Tostring() const { // declare a stringstream object stringstream strout; // build the string // strout
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started