Write Circle Class Following Member Variables Radius Double Pi Double Initialized 314159 C Q37144778

Write a Circle class that has the following membervariables:

  • radius as a double
  • PI as a double initialized with 3.14159

The class should have the following member functions:

  • Default constructor Sets the radius as 0.0 and pi as3.14159
  • Constructor Accepts the radius of the circles as anargument
  • setRadius A mutator
  • getRadius An accessor
  • getArea Returns the area of the circle
  • getDiameter Returns the diameter of the circle
  • getCircumference Returns the circumference of the circle

Write a program that demonstrates the Circle class by asking theuser for the radius, creating a Circle class object and then usesthe object to test the class.

Sample output:

Enter the circle’s radius: 55.5

Radius: 55.5

Area :

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.