Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

write functions double sphere_volume(double r) double sphere_surface(double r) d

ID: 3644153 • Letter: W

Question

write functions
double sphere_volume(double r)
double sphere_surface(double r)
double cylinder_volume(double r, double h)
double cylinder_surface(double r, double h)
double cone_volume(double r, double h)
double cone_surface(double r, double h)

that compute the volume and surface area of a sphere with radius r, a cylinder with circular base with radius r and height h, and a cone with a circular base with radius r and height h. then write a program that prompts the user for the values of r and h, calls the six functions,and prints the results.

Explanation / Answer

include using namespace std; double sphere_volume(double radius){ // V = 4/3 (pi*r*r*r) return (1.333333 * 3.14159 * radius * radius * radius); } double sphere_surface(double radius){ // A = 4*pi*r*r return (4 * 3.14159 * radius * radius); } double cylinder_volume(double radius, double height){ // V = pi * r * r * h return 0; } double cylinder_surface(double radius, double height){ // A = 2 * pi * r * (r + h) return 0; } double cone_volume(double radius, double height){ // V = 1/3 3.14159 * r * r * h return 0; } double cone_surface(double radius, double height){ // A = pi * r * r + pi * r * sqrt(r*r + h*h) return 0; } int main(){ double height = 0; double radius = 0; // Get the radius and height from the user. cout