You are making a drawing application, which has a Shape
base class.
The given code defines a Rectangle
class, creates a Rectangle
object and calls its area()
and perimeter()
methods.
Do the following to complete the program:
- Inherit the
Rectangle
class fromShape
. - Define the
perimeter()
method in theRectangle
class, printing theperimeter
of the rectangle.
The
perimeter
is equal to2 * (width + height)