Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help creating a sphere class in c++ with the following specifications. I don't know too much about classes so any help is appreciated.
I need help creating a sphere class in c++ with the following specifications. I don't know too much about classes so any help is appreciated.
Sphere Class edikl Using a h and.cpp fe, implement a Sphere class with the following data flelds and methods. Constant Use the lolowing value for Pl- 3.14159 Dete radius: doube s color: string Methods Sphere()-default constructor . should set th radius to one and color to green . Sphero(doubler) _ custom constructor -sets the radius toand color to green Sphere double r string c) custom conistructor sets the radius to r and color to c a void setRadius doubla) mutator method used to change the radius a double getRadius) const constant function that return the radius void setColorlstring) mutaior method to sel the color of the Sphere string gelCokr) const constant accessor method that retum the color of the Sphere adouble area) const constent function that returns the surface area of the Sphere surface area = 42 . double volume()const constent function that returns the volume of the Sphere . volume=- a bool isEqusl(const Sphere other) const constant boolean function that return TRUE is two Spheres have the same radius and color, FALSE otherwise Deliverables edirl Sphere.h Sphere.cppStep 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