#include "Circle.h" #include "Rectangle.h" #include "Square.h" #include #include int main() { // Obtain shape from user char answer; cout << "Is the room a circle, rectangle, or square (C/S/R)? "; cin >> answer; Shape *shape; // Determine which object to use if (toupper(answer) == 'C') { shape = new Circle(); } else if (toupper(answer) == 'R') { shape = new Rectangle(); } else if (toupper(answer) == 'S') { shape = new Square(); } else cout << "Bad shape." << endl; shape->get_info(); cout << "Area = " << shape->area() << endl; cout << "Perimeter = " << shape->perimeter() << endl; cout << "Sum of area and perimeter = " << shape->area() + shape->perimeter() << endl; cout << "Difference of area and perimeter = " << shape->area() - shape->perimeter() << endl; delete shape; }