-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVolume.py
29 lines (22 loc) · 959 Bytes
/
Volume.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
##MICHAEL_BENNETT
##SDEV300_7380
##Professor_Zachery_Fair
##Week2_assignment2_Calculate_the_Volume_of_a_Right_Circular_Cylinder6
##3/28/2023
# Program to calculate the volume of a right circular cylinder
# Importing math library
import math
# Taking the radius and height of the cylinder as input from the user
radius = float(input("Enter radius of the cylinder ( cm): "))
height = float(input("Enter height of the cylinder ( cm): "))
# Calculating the volume of the cylinder using the formula given
volume = math.pi * radius * radius * height
# Printing the result
print("\nVolume of the Cylinder =", volume, "cubic centimeter")
# Process and Calculations:
# Formula used: Volume of Circular Cylinder = (πr2) × Henormula 'Volume of Circular Cylinder = (πr2) × Height'
# Printing the result
# Details:
# Radius of the Cylinder: _____ cm
# Height of the Cylinder: _____ cm
# Volume of the Cylinder: _____ cubic centimeter