Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Coding Question: Write a text-based IPO program that has the user enter the radius and height of a right circular cylinder and then displays

Python Coding Question:

Write a text-based IPO program that has the user enter the radius and height of a right circular cylinder and then displays the cylinder's diameter, cross-sectional area, wall area, surface area, and volume.

Formulas: Diameter: D = square root(4 r2 + h2) Cross-sectional area: A = r2 Wall area: W = 2 r h Surface area: S = 2 A + W Volume: V = A h

Write one function for each of the five quantities; each function should have exactly two parameters, one for radius and one for height, even those whose formulas don't involve r or h (such as surface area and volume) and should return the value. When one of the other quantities is needed, the appropriate function should be called. (For example, the formula for surface area requires the cross-sectional and wall area; the surface area function should still have just r and h for parameters and would obtain A and W by calling the crossSectionalArea and wallArea functions.) Your main( ) function is the only one that is allowed to use input( ) or print( ).

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

More Books

Students also viewed these Databases questions