design write compile and run a C++ program to calculate the volume and the surfa
ID: 3535793 • Letter: D
Question
design write compile and run a C++ program to calculate the volume and the surface area of a sphere, write this program using object orienent programming. create a class call sphere that consisits of three provate memebers of type double- radius surfaceArea and volume. include two class constructors (default constructor and constructor with one arguement that will take the radius), acessor functions for the volume and surface area. write your main() program to demostrate the your sophere class works
Surface area = 4*pi*radius*radius
volume = 4/3*pi*radius*radius*radius
Explanation / Answer
#include #include #include #include using namespace std; char q = ''; const char SENTINEL = 'q'; float radius, answer; void get_radius (float&); float surface_area (float); float volume (float); float cross_section (float); const float PI = 3.14; int main() { coutRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.