Question: In Python write functions: def sphereVolume ( r ) def sphereSurface ( r ) def cylinderVolume ( r , h ) def cylinderSurface ( r

In Python write functions:
def sphereVolume(r)
def sphereSurface(r)
def cylinderVolume(r, h)
def cylinderSurface(r, h)
def coneVolume(r, h)
def coneSurface(r, h)
that compute the volume and surface area of a sphere with radius r, a cylinder with a circular base with radius r and height h, and a cone with a circular base with radius r and height h. You will need to use the pi and sqrt() functions from the math library. Then, write a program that prompts the user for the values of r and h, calls the six functions, and prints the results.
The formulas are
volume of a sphere
V=4
3
\pi
r3
surface area of a sphere
A=4
\pi
r2
volume of a cylinder
V=\pi
r2
h
surface area of a cylinder
A=2
\pi
r
h+2
\pi
r2
volume of a cone
V=\pi
r2
h
3
surface area of a cone
look this up on Google
The input and out should look like this (the user entered numbers are in bold for example only):
Enter the radius: 4.5
Enter the height: 6.5
A sphere has volume: 381.7035074111598
A sphere has surface area: 254.46900494077323
A cylinder has volume: 413.5121330287565
A cylinder has surface area: 311.0176727053895
A cone has volume: 137.83737767625217
A cone has surface area: 175.38136922539945

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!