367,061 views
39 votes
39 votes
In C++

Write a simple program to test your Circle class. The program must call every member function at least once. The program can do anything of your choice.

User Sytolk
by
3.0k points

1 Answer

21 votes
21 votes

Answer:

int main() {

Circle* pCircle = new Circle(5.0f, 2, 3);

pCircle->up();

pCircle->down();

pCircle->left();

pCircle->right();

cout << "X: " << pCircle->getx() << endl;

cout << "Y: " << pCircle->gety() << endl;

cout << "Radius: " << pCircle->getRadius() << endl;

pCircle->print();

pCircle->update_radius(4.0f);

if (pCircle->isUnit()) {

cout << "is unit" << endl;

}

pCircle->move_x(10);

pCircle->move_y(10);

}

Step-by-step explanation:

something like that?

User Mohammed Shakeer
by
2.7k points