Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

a create an object of class circle and object of class point Explanat... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Physics

Authors: Alan Giambattista, Betty Richardson, Robert Richardson

2nd edition

77339681, 978-0077339685

More Books

Students also viewed these Programming questions

Question

Calculate the binding energy per nucleon for a 14/7N nucleus.

Answered: 1 week ago

Question

Explain and criticize the JamesLange theory of emotion.

Answered: 1 week ago

Question

When should you avoid using exhaust brake select all that apply

Answered: 1 week ago

Question

high proportion of women enrolled in universities

Answered: 1 week ago

Question

low proportion of Muslims

Answered: 1 week ago