Question: 47 In C++ Please #include #include using namespace std; /** * defining class circle */ class Circle { //defining public variables public: double pi; double

47 In C++ Please #include  #include  using namespace std; /** * defining class circle */ class Circle { //defining public variables public: double pi; double radius; public: //default constructor to initialise variables Circle(){ pi = 3.14159; radius = 0; } Circle(double r){ pi = 3.14159; radius = r; } // defining getter and setters void setRadius(double r){ radius = r; } double getRadius(){ return radius; } // method to get Area double getArea(){ return pi*radius*radius; } }; //main method int main() { //declaring and taking input of radius double r; cout<<"Enter radius: "; cin>>r; //making an object of class circle Circle c(r); //printing area of circle cout<<"Area = "< 

Write a statement that defines an array of five objects of the Circle class in the above source code. Pass the following arguments to the elements constructor: 12, 7, 9, 14, and 8.

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!