Question: #include using namespace std; // __________________________________________________________________ // // This program declares a class for a circle that will have // member functions that set the

 #include using namespace std; // __________________________________________________________________ // // This program declares

a class for a circle that will have // member functions that

#include  using namespace std; // __________________________________________________________________ // // This program declares a class for a circle that will have // member functions that set the center, find the area, find // the circumference and display these attributes. // The program as written does not allow the user to input data, but // rather has the radii and center coordinates of the circles // (spheres in the program) initialized at definition or set by a function. // class declaration section (header file) // PLACE YOUR NAME HERE class Circles { public: void setCenter(int x, int y); double findArea(); double findCircumference(); void printCircleStats(); // This outputs the radius and center of the circle. Circles(float r); // Constructor Circles(); // Default constructor private: float radius; int center_x; int center_y; }; const double PI = 3.14; // Client section int main() { Circles sphere(8); sphere.setCenter(9, 10); sphere.printCircleStats(); cout  

Please just follow the introduction on exercise(do not modfiy to the other form) and do not copy from other webpage because the code is different than the others.

This is important so that I can learn some thing from your anwser. Thx

Exercise 1: Alter the code so that setting the center of the circle is also done during the object definition. This means that the constructors will also take care of this initialization. Make the default center at point (0, 0) and keep the default radius as 1. Have sphere defined with initial values of 8 for the radius and (9, 10) for the center. How does this affect existing functions and code in the main function? The following output should be produced: The radius of the circle is 8 The center of the circle is (9, 10) The area of the circle is 200.96 The circumference of the circle if 50.24 Exercise 2. There can be several constructors as long as they differ in number type. Alter the so that the user can enter of parameters or data either just the radius, the radius and the center, or nothing at the time the object is defined. Whatever the user does NOT include (radius or center) must be initialized somewhere. There is no setRadius function and there will no longer be a setCenter function. You can continue to assume that the default radius is 1 and the default center is (0, 0). Alter the client portion (main) of the program by defining an object spherel, giving just program

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!