// figure.cpp - implements class Figure // cmc, 11/16/2012 #include "figure.h" #include using namespace std; Figure::Figure(char s, int o) : symbol(s), offset(o) { } Figure::Figure() : symbol('*'), offset(0) { } void Figure::print() const { shift(); cout << symbol << endl; } void Figure::printAt(int lines) const { for (int i = 0; i < lines; i++) cout << endl; print(); // notice use of print() here } void Figure::shift() const { spaces(offset); } void Figure::symbols(int n) const { for (int i = 0; i < n; i++) cout << symbol; } void Figure::spaces(int n) const { for (int i = 0; i < n; i++) cout << ' '; }