#include using namespace std; class Rectangle { private: int width, height; public: Rectangle(int width, int height); void setWidth(int width); void setHeight(int height); int getWidth() const; int getHeight() const; int getWidth() ; int getHeight(); }; Rectangle::Rectangle(int width, int height) { this->width = width; this->height = height; } void Rectangle::setWidth(int width) { this->width = width; } void Rectangle::setHeight(int height) { this->height = height; } int Rectangle::getWidth() const { cout << "I am the const method\n"; return width; } int Rectangle::getHeight() const { return height; } int Rectangle::getWidth() { cout << "I am the non-const method\n"; return width; } int Rectangle::getHeight() { return height; } int main() { const Rectangle rect1(10,5); Rectangle rect2(10,5); cout << "rect1 width: " << rect1.getWidth() << endl; cout << "rect2 width: " << rect2.getWidth() << endl; }