- Problem 2 Right Cylinder Volume Write A Program Yourname Volume Py That Prints The Volume Of A Right Cylinder Given The 1 (79.82 KiB) Viewed 9 times
Problem 2: Right Cylinder Volume Write a program yourname_volume.py that prints the volume of a right cylinder given the
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Problem 2: Right Cylinder Volume Write a program yourname_volume.py that prints the volume of a right cylinder given the
Problem 2: Right Cylinder Volume Write a program yourname_volume.py that prints the volume of a right cylinder given the base's circumference and the cylinder's height. The program should be written as three functions: main(): takes in two piece of input from the user as floats (the cylinder's base circumference and the cylinder's height), calls other functions, and prints the result. calculate_radius(circumference): takes the base's circumference as a parameter and calculates the base's radius. Return the radius as a float. calculate_volume(radius, height): takes the base's radius and the cylinder's height as parameters and calculates the volume. Return the volume as a float. CALCULATE RADIUS GIVEN CIRCUMFERENCE r = C 2 п circumference radius CALCULATE VOLUME GIVEN RADIUS AND HEIGHT V = лr²h height radius