Creating Square Extending Rectangle Class Use Rectangle Class Base Class Square Key Concep Q37022953

Creating a Square, extending the Rectangleclass

We will now use the rectangle class as the base class for aSquare. This is the key concept for inheritance. This derivedclass, the Square class will take on all the qualities of arectangle, but create a more focused set of qualities. In the classyou will create:

  1. The private data shall consist of 0 members:
    1. There is no private data, alldata is inherited from the base class.
  2. One constructor
    1. A single constructor with 1 parameter that calls the baseconstructor.
  3. One mutator
    1. setLength to set the side length.
  4. Two accessors:
    1. getLength to get the side length.
    2. printObject that over-rides the print accessor of the
      OR
      OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.