Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a Circle class that has the following data members: radius: a double The c

ID: 3634755 • Letter: W

Question

Write a Circle class that has the following data members:


radius: a double

The class should have the following member functions:

Write a program the demonstrate the Circle class perform the following
tasks:

Explanation / Answer

#include using namespace std; class Circle { private: double pi; double radius; public: Circle() { pi = 3.14159; radius =0.0; } Circle(double radius) { pi = 3.14159; this->radius = radius; } void setRadius(doubleradius) { this->radius = radius; } double getRadius() { returnradius; } double getArea() { return pi* radius * radius; } double getDiameter() { returnradius * 2; } double getCircumfrence() { return 2 *pi * radius; } }; int main() { /* Data object and variable. */ Circle circle = Circle(); double radius; /* Introductory message. */ cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote