Write a program that defines a class circle and implement


Task:

Write a program that defines a class Circle and implement it as required. The class Circle should consist of three private member variables: radius of type double, Pi of type double and color of type string. Circle should also include the following member functions:

1. to output the area and diameter of the circle.

2. to set Pi to the value of 3.14159.

3. to set the radius according to the parameters.

4. to set the color according to the parameter.

5. to return Pi.

6. to return the radius.

7. to return the color.

8. to return the area of the circle. area = pi* radius * radius.

9. getCircumference to return circumference of the circle. circumference = 2 * pi * radius

10 .A default constructor to initialize radius 1 pi to 3.14.159 and color to "white".

11. A constructor that initializes radius, Pi and color according to the parameters.

You should put the class definition in a header file Circle.h and put the class implementation in an implementation file Circle.cpp.

In the function main, write statements to test your class Circle ensuring that all functions are tested and executed.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a program that defines a class circle and implement
Reference No:- TGS02944996

Expected delivery within 24 Hours