Question: Running the code below will a. create an object of class circle and object of class point b. None of the answers c. Compile-time Error

Running the code below will

a. create an object of class circle and object of class point

b. None of the answers

c. Compile-time Error because no default constructors in both classes

d. create the only object of class circle

class Point{

    int x;

    int y;


    public:

    Point (int x, int y){

        this->x=x;

        this->y=y;

    }

    void setX(int a){x=a;}

    void setY(int a){y=a;}

    int getX(){return x;}

    int getY(){return y;}

};//End of class Student


class Circle{

    int d;

    Point *center;


public:

    Circle(int d, int x, int y){

        this->d=d;

        center=new Point (x,y);

        }

    void setPoint(int x, int y){

        center->setX(x);

        center->setY(y);

    }

    Point *getPoint(){return center;}

    

};



int main() {

    // insert code here...

    Circle c1(30, 4,5);

}


Step by Step Solution

3.47 Rating (160 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

a create an object of class circle and object of class point Explanat... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!