Question: #include using namespace std; // Class declaration class Circle{ private: double radius; public: Circle(); Circle(double); void setRadius(double); double getRadius(); double getArea(); double getCircumference(); void printCircle();
#includeusing namespace std; // Class declaration class Circle{ private: double radius; public: Circle(); Circle(double); void setRadius(double); double getRadius(); double getArea(); double getCircumference(); void printCircle(); }; int main(){ // declare a Circle object, named circle1, using the default constructor // assign the value 3.5 to the radius of circle1, using the setRadius method // call the method printCircle for circle1 // declare a Circle object, named circle2, using the parameterized constructor // with the value 5.25 as argument // call the method printCircle for circle2 // Print "Program developed by [YOUR NAME], ID#[YOUR ID NUMBER]" // where the square brackets and the text within is substitued with // your personal information. return 0; } // Class method definition // Make sure to use the class scope (Circle::) operator for each method // The default constructor sets the value of radius to 0 Circle(){ } // The parameterized constructor receives a double, named aRadius, // as parameter and assigns the value of the parameter to radius Circle(double){ } // The setRadius method receives a double, named aRadius, // as parameter and assigns the value of the parameter to radius void setRadius(double){ } // The getRadius method has no parameters and returns the value of radius double getRadius(){ } // The getArea method has no parameters // and returns the area of the circle double getArea(){ } // The getCircumference method has no parameters // and returns the circumference of the circle double getCircumference(){ } // The printCircle method prints following text: // "The circle with radius [radius] has an area // of [area] and a circumference of [circumference] " // The area and circumference values are obtained by // calling the getArea and getCircumference methods void printCircle(){ }
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
