// rectangle.cpp - implements class Rectangle // cmc, 11/16/2012 #include "rectangle.h" #include using namespace std; Rectangle::Rectangle(char s, int o, int w, int h) : Figure(s, o), width(w), height(h) { } Rectangle::Rectangle() : width(4), height(3) { } void Rectangle::print() const { printLine(); for (int i = 1; i < height-1; i++) { shift(); symbols(1); spaces(width - 2); symbols(1); cout << endl; } printLine(); } void Rectangle::printLine() const { shift(); symbols(width); cout << endl; }