4.4 Inheritance: the Rectangle derived class
-
Modify the
Rectangleclass so that it also becomes a derived class ofShape:- Add
: Shape; - Remove the attributes
LimitValueForBigShapeand_color; - Modify the all-args constructor: call
base(color)and removethis._color = color; - Adjust the constructor that passes the default value for color;
- Override the methods
CalculatePerimeter()andCalculateArea(); - Remove the
DescribeSize()method; - Remove the getter and setter for color.
- Add
-
Uncomment the code about the rectangle and run your program. Your output is the same as in 3.5 The Rectangle class.