Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Something original please Create a circle class in a separate header file that has the following private member variables: 1. Radius: a double 2. Pi:
Something original please
Create a circle class in a separate header file that has the following private member variables: 1. Radius: a double 2. Pi: a double initialized to 3.14159 The class will have the following member functions: 1. Default Constructor that sets the radius to 0.0 (even though the program does not use it) 2. A Constructor that accepts the radius of the circle as an argument (the program will use this) 3. setRadius -a mutator function for the radius variable 4. getRadius an accessor function for the radius variable 5. getArea - returns that area of the circle (area = pi * radius * radius) 6. getDiameter - returns the diameter of the circle ( diameter = radius * 2) 7. getCircumference - returns the circumference of the circle (circ = 2 * pi * radius) Requirements: Write a program that demonstrates the circle class by prompting the user for the circle's radius (with input validation), create a circle object using the overloaded contructor, and then report the area, diameter, and circumference with the output precision set to (2) two decimal places. Use a separate header file for the class. Add a UML Diagram for the class as a comment below main (10%). The program will: . Use a separate *.h file for the class and a *.cpp file for main. Use 3.14159 as the value for pi Include #ifndef, and #endif directives as required Have a UML diagram with Access Specifiers (ref Figure 13-24 pg 801) as a comment below main. . . ***************** ******************** // ************* // CLASS NAME // *** ******** // MEMBER VARIABLES // // ********************************** // MEMBER FUNCTIONS II MEMBER FUNCTIONS // // ********************************** Grading will be based on meeting all of the lab requirements, adherence to programming standards, operation and accurate output, and programming style including white space and indentation. Assignments submitted after the due data willinn the list uay, anu w II TIUL Uc acccpcu morum Sample Main: // Chapter 13, Programming Challenge 8: Circle Class int main() { double radius = 0; // To hold a radius // Get the radius. while (radius > radius; if(radius > radius; if(radiusStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started