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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started