class Circle
{
private:
double radius;
double pi = 3.14;
public:
Circle();
Circle(int r);
void setRadius(int r);
double getRadius() const;
double getArea() const;
};
Write a Circle Class that has the following member variables:
radius: a double
pi: a double initialized with the value 3.14
The class should have the following member functions:
Default Constructor - a default constructor that sets radius 0.0
Constructor - accepts the radius of the circle as an argument
setRadius - A mutator method for the radius variable
getRadius - An accessor method for the radius variable
getArea - Returns the area of the circle

New Topic/Question
Reply



MultiQuote









|