Question: CSE 112-Lab #6 Circle Class-Classes and Objects (page 811-#8) and UML Diagram Create a circle class that has the following private member variables 1. Radius:


CSE 112-Lab #6 Circle Class-Classes and Objects (page 811-#8) and UML Diagram Create a circle class 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 2. A Constructor that 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 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, 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 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 #ifnder, and #endif directives as required Have a commented UML diagram with Access Specifiers in the program below main (ref pg 793) . . II CLASS NAME II MEMBER VARIABLES II MEMBER FUNCTIONS
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
