### need help on a function

I'm getting a error on my
constructor. My instructions is 'Add a constructor that accepts one argument and uses it to set the radius.'

 ``123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119`` ``````#include #include using namespace std; class Circle { private: double x; double y; double radius; public: Circle(); Circle(double); Circle(double, double, double); void setRadius(double); void setX(double); void setY(double); double getRadius(); double getX(); double getY(); double getArea(); bool containsPoint(double, double); }; Circle::Circle() { x=0; y=0; radius =1; } Circle::Circle(double radiusValue) { radius = radiusValue; } Circle::Circle(double xValue, double yValue, double radiusValue) { x = xValue; y = yValue; radius = radiusValue; } void Circle::setRadius(double r) { radius = r; } void Circle::setX(double xCord) { x = xCord; } void Circle::setY(double yCord) { y = yCord; } double Circle::getRadius() { return radius; } double Circle::getX() { return x; } double Circle::getY() { return y; } double Circle::getArea() { return 3.14*radius*radius; } bool Circle::containsPoint(double xValue, double yValue) { bool status; double d; d = sqrt(pow((xValue - x), 2.0) + pow((yValue - y), 2.0)); if (d <= radius) status = true; else status = false; return status; } int main() { int i; double circX; double circY; double circRadius; double ptX; double ptY; cout << "You will enter data for 3 circles.\n"; for (i=0; i<3; i++) { Circle c; cout << "x: " << c.getX() << endl; cout << "y: " << c.getY() << endl; cout << "radius: " << c.getRadius() << endl; cout << "Enter the x coordinate of the center of your circle" << (i+1) << ": "; cin >> circX; cout << "Enter the y coordinate of the center of your circle" << (i+1) << ": "; cin >> circY; cout << "Enter the radius of your circle" << (i+1) << ": "; cin >> circRadius; c.setX(circX); c.setY(circY); c.setRadius(circRadius); cout << "Enter a x coordinate to test circle" << (i+1) << ": "; cin >> ptX; cout << "Enter a y coordinate to test circle" << (i+1) << ": "; cin >> ptY; cout << "The area of your circle" << (i+1) << " is: " << c.getArea() << endl; if (c.containsPoint(ptX, ptY)) cout << "Circle" << (i+1) << " contains the point (" << ptX << ", " << ptY << ")"<< endl; else cout << "Circle" << (i+1) << " does not contain the point (" << ptX << ", " << ptY << ")"<< endl; } }``````
why are you writing constructor..
 ``12`` ``````Circle(double); Circle(double, double, double);``````

you are not using them please remove them...
Compiles fine, what the error is?
 I'm getting a error

What error? We can't read your mind.
Topic archived. No new replies allowed.