Professional Documents
Culture Documents
Use The Declaration of Rectangle Class Below To Work On Polymorphism
Use The Declaration of Rectangle Class Below To Work On Polymorphism
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?