#include //include //using namespace std; class Rectangle { public: Rectangle(); ~Rectangle(); void SetLength(int length) { this->length = length; } int GetLength() const { return this->length; } void SetWidth(int width) { this->width = width; } int GetWidth() const { return this->width; } private: int length; int width; }; Rectangle::Rectangle() { width = 5; length = 10; } Rectangle::~Rectangle() { } int main() { Rectangle theRect; cout << "theRect är " << theRect.GetLength() << " meter lång.\n"; cout << "theRect är " << theRect.GetWidth() << " meter lång.\n"; theRect.SetLength(20); theRect.SetWidth(10); cout << "theRect är " << theRect.GetLength() << " meter lång.\n"; cout << "theRect är " << theRect.GetWidth() << " meter lång.\n"; return 0; }