Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 1

Use the declaration of rectangle class below to

work on polymorphism.
class Rectangle {
public:
Rectangle();
void setWidthHeight (double width, double height);
double area ();
double perimeter();
private:
double width_, height_;
};
How could we use polymorphism to allow the class
to be used for a square?

You might also like