Write class that has the member variables


Problem

Write class that has the following member variables: radius- a double; pi - a double initialized with the value 3.14159

The class should have the following member functions:

1) Default Constructor - that sets radius to 0.0
2) Constructor - accepts the radius of the circle as an argument
3) setRadius - a mutator function for the radius variable
4) getRadius - an accessor function for the radius variable
5) getArea - returns the area of the circle, which is calculated as area = pi * radius * radius
6) getDiameter - returns the diameter of the circle, which is calculated as diameter = radius * 2
7) getCircumference - returns the circumference of the circle, which is calculated as circumference = 2 * pi * radius

Write program that demonstrates the Circle class by asking the user for the circle's radius, creating a Circle object, then reporting the circle's area, diameter, and circumference.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write class that has the member variables
Reference No:- TGS03255371

Expected delivery within 24 Hours