Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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.cpp

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions

Question

7. Senior management supports the career system.

Answered: 1 week ago