Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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). cone surface area(r, h): returns the surface area of a cone of radius r and height h

(b). cone volume(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: r2 + r r^2 + h^2

Volume of a cone: r^2h/3 (This is pi*r^2*h not as an exponent all divided by 3)

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

I am using Python IDLE as my program and am using python as my code for this assignment

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

Students also viewed these Databases questions