A+ Work





Be sure to follow the Coding Standard Guidelines.  You must properly indent and comment your code. 
Indent code and insert comments to document your program. 
Program must be implemented and run as instructed
Source file and executable are placed in a folder.  The folder is zipped up into a file.

Capitalize the first letter of the derived class names.


Derive class boxType from the class rectangleType, defined in part 2, add the functions to overload the operators +, -, *, ==, !=, <=, <, >=, >, and pre- and post-increment and decrement operators as members of the class boxType. Also overload the operators << and >>. Overload the relational operators by considering the volume of the boxes. For example, two boxes are the same if they have the same volume.

The class rectangleType is used to illustrate how to overload the operators +, *, ==, !=, >>, and <<. Redefine the class rectangleType by declaring the instance variables as protected and then overload additional operators as defined in parts a to c.

Overload the pre- and post-increment and decrement operators to increment and decrement, respectively, the length and width of a rectangle by one unit. (Note that after decrementing the length and width, they must be positive.)
Overload the binary operator – to subtract the dimensions of one rectangle from the corresponding dimensions of another rectangle. If the resulting dimensions are not positive, output an appropriate message and do not perform the operation.
The operators == and != are overloaded by considering the lengths and widths of rectangles. Redefine the functions to overload the relational operator by considering the areas of rectangles as follows: Two rectangles are the same, if they have the same area; otherwise, the rectangles are not the same. Similarly, rectangle yard1 is greater than rectangle yard2 if the area of yard1 is greater than the area of yard2. Overload the remaining relational operators using similar definitions.
Write the definitions of the functions to overload the operators defined in parts a to c.
Write a test program that tests various operations on the class rectangleType.


Write the definitions of the functions of the class boxType as defined in part 1.

Write a test program that tests various operations on the class rectangleType.