Write a C++ application that calculates the area of a circle and square. Organize the code into header files (Circle.h, Square.h) and implementation files (Circle.cpp. Square.cpp. main.cpp)
#include
// using IO functions #include // using string using namespace std; class Circle { private: double radius; // Data member (Variable) string color; // Data member (Variable) public: // Constructor with default values for data members Circle(double r = 1.0, string c = \"red\") { radius = r; color = c; } double getRadius() { // Member function (Getter) return radius; } string getColor() { // Member function (Getter) return color; } double getArea() { // Member function return radius*radius*3.1416; } }; // need to end the class declaration with a semi-colon // Test driver function int main() { // Construct a Circle instance Circle c1(1.2, \"blue\"); cout << \"Radius=\" << c1.getRadius() << \" Area=\" << c1.getArea() << \" Color=\" << c1.getColor() << endl; // Construct another Circle instance Circle c2(3.4); // default color cout << \"Radius=\" << c2.getRadius() << \" Area=\" << c2.getArea() << \" Color=\" << c2.getColor() << endl; // Construct a Circle instance using default no-arg constructor Circle c3; // default radius and color cout << \"Radius=\" << c3.getRadius() << \" Area=\" << c3.getArea() << \" Color=\" << c3.getColor() << endl; return 0; }