#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; // Determine which object to use if (toupper(answer) == 'C') { Circle shape; 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; } else if (toupper(answer) == 'R') { Rectangle shape; 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; } else if (toupper(answer) == 'S') { Square shape; 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; } else cout << "Bad shape." << endl; }