#include #include using namespace std; class Rectangle { public: Rectangle(); ~Rectangle(); string getname(); int getheight(); int getlength(); int getwidth(); void setname(string n); void setheight(int h); void setlength(int l); void setwidth(int w); int volume(); int surfaceArea(); private: string name; int height; int length; int width; }; Rectangle::Rectangle() { name = "Rectangle"; height = length = width = 0; } Rectangle::~Rectangle() { } void Rectangle::setname(string n) { name = n; } void Rectangle::setheight(int h) { height = h; } void Rectangle::setlength(int l) { length = l; } void Rectangle::setwidth(int w) { width = w; } string Rectangle::getname() { return name; } int Rectangle::getheight() { return height; } int Rectangle::getlength() { return length; } int Rectangle::getwidth() { return width; } int Rectangle::volume() { return height * length * width; } int Rectangle::surfaceArea() { return ((height * width * 2) + (length * width * 2) + (height * length * 2)); } int main(void) { Rectangle big; big.setname("Big"); cout << big.getname() << endl; big.setheight(10); big.setlength(10); big.setwidth(10); cout << big.surfaceArea() << endl; cout << big.volume() << endl; return 0; }