Question: Problem 2 You will write a program computeCones() that prompts the user for the radius and height of a 3-dimensional cone and then calculates and

Problem 2

You will write a program computeCones() that prompts the user for the radius and height of a 3-dimensional cone and then calculates and prints the surface area and volume of the

cone. The calculation of the surface area and the volume will be done in functions, as will the gathering of the inputs.Your program for this part will function as follows:

(i). Print out a message indicating what the program does

(ii). Prompt the user for the radius (a non-negative float) in feet

(iii). Prompt the user for the height (a non-negative float) in feet

(iv). Print the radius and height, but rounded to 2 decimal digits

(v). Print the surface area and volume, rounded to 2 decimal digits

This version of the program will not check that the input is correct; if the user types anything other than a non-negative float, it can crash.Your program must define and invoke two functions:

(a). conesurfacearea(r,h): returns the surface area of a cone of radius r and height h

(b). conevolume(r,h): returns the volume of a cone of radius r and height h

The formulas for finding these values are as follows:

Surface area of the Cone:r^2r^2+h^2

Volume of a cone:(r^2h)/3

Import the math module and use math.pi and math.sqrt() in these calculations.

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!