Question: C++ Problem Given the following code: class Circle { private: double radius; public: Circle(); Circle(double); double getRadius(); void setRadius(double); }; Circle::Circle() { radius = 0;
C++ Problem
Given the following code:
class Circle { private: double radius; public: Circle(); Circle(double); double getRadius(); void setRadius(double); }; Circle::Circle() { radius = 0; } Circle::Circle(double rad) { radius = rad; } double Circle::getRadius() { return radius; } void Circle::setRadius(double r) { radius = r; } int main() { const int SIZE = 10; Circle myCircles[SIZE]; // Add code here!!! return 0; } Write the code in the main that would first have the user initialize the radii of the array of circles, then print out the diameter (i.e. twice the radius) of the array of circles.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
