//File: circle2.cpp IMPLEMENTATION file #include #include "circle.h" using namespace std; const double PI = 3.14159; circle::circle () { m_x = 0.0; m_y = 0.0; m_rad = 1.0; m_name = "Unit Circle"; } circle::circle (double xcoord, double ycoord, double radius, string name) { m_x = xcoord; m_y = ycoord; m_rad = radius; m_name = name; } circle::~circle () { } double circle::circumference () const { return (m_rad * 2.0 * PI); } double circle::radius () const { return m_rad; } string circle::name () const { return m_name; } void circle::center (double & x, double & y) const { x = m_x; y = m_y; } ostream & operator << (ostream & out, const circle & c) { double x, y; c.center(x,y); out << c.name() << " is located at (" << x << ", " << y << ")" << endl; out << "Its radius is: " << c.radius() << endl; out << "Its circumference is: " << c.circumference() << endl; out << endl; return out; }