-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconcalc.py
68 lines (58 loc) · 2.39 KB
/
concalc.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Python program to calculate the volume of concrete needed for curb/gutter, sidewalk, and patio
# returns cubic yards
def sidewalk(thickness_in, width_ft, length_ft):
thickness_yd = thickness_in / 36
width_yd = width_ft / 3
length_yd = length_ft / 3
sidewalk_vol = (width_yd * length_yd * thickness_yd)
return sidewalk_vol
def patio(thickness_in, width_ft, length_ft):
thickness_yd = thickness_in / 36
width_yd = width_ft / 3
length_yd = length_ft / 3
patio_vol = (width_yd * length_yd * thickness_yd)
return patio_vol
def curb(toe_in, base_ft, curb_in, face_in, length_ft):
toe_yd = toe_in / 36
base_yd = base_ft / 3
curb_yd = curb_in / 36
face_yd = face_in / 36
length_yd = length_ft / 3
curb_vol = ((base_yd * toe_yd) + (curb_yd * face_yd)) * length_yd
return curb_vol
def main():
print("Curb, Sidewalk, or Patio?")
if input() == "Curb" or "curb":
print("Enter the toe of the curb in inches:")
toe_in = int(input())
print("Enter the base of the curb in feet:")
base_ft = int(input())
print("Enter the length of the curb in feet:")
length_ft = int(input())
print("Enter the thickness of the curb in inches:")
int(input())
print("Enter the face of the curb in inches:")
face_in = int(input())
print("Enter the curb in inches:")
curb_in = int(input())
print("The volume of the curb is:", curb(toe_in, base_ft, curb_in, face_in, length_ft))
elif input() == "Sidewalk" or "sidewalk":
print("Enter the thickness of the sidewalk in inches:")
thickness_in = int(input())
print("Enter the width of the sidewalk in feet:")
width_ft = int(input())
print("Enter the length of the sidewalk in feet:")
length_ft = int(input())
print("The volume of the sidewalk is:", sidewalk(thickness_in, width_ft, length_ft))
elif input() == "Patio" or "patio":
print("Enter the thickness of the patio in inches:")
thickness_in = int(input())
print("Enter the width of the patio in feet:")
width_ft = int(input())
print("Enter the length of the patio in feet:")
length_ft = int(input())
print("The volume of the patio is:", patio(thickness_in, width_ft, length_ft))
else:
print("Please enter either 'Curb', 'Sidewalk', or 'Patio'")
main()
main()