You are viewing a single comment's thread. Return to all comments →
I didn't get your point... That's my solution and works fine
/* * Create classes Rectangle and RectangleArea */ class Rectangle { public: virtual void display() const { cout << width << ' ' << height << endl; } protected: int width; int height; }; class RectangleArea : public Rectangle { public: void display() const override { cout << (width * height) << endl; } void read_input() { cin >> width >> height; } };
Seems like cookies are disabled on this browser, please enable them to open this website
Rectangle Area
You are viewing a single comment's thread. Return to all comments →
I didn't get your point... That's my solution and works fine