Skip to content

Commit eb2d2db

Browse files
author
Oleksandr Krotkov
committed
Added main.py
I copied all the code from google docs and pasted it here.
0 parents  commit eb2d2db

File tree

1 file changed

+114
-0
lines changed

1 file changed

+114
-0
lines changed

main.py

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
"""
2+
cost for all materials ( THAT ARE CONSTANTS )
3+
"""
4+
price_concrete = 150
5+
price_joist = 24.07
6+
price_studs = 2.72
7+
8+
9+
10+
"""
11+
Part one- Chemai
12+
"""
13+
length = int(input("What's length of your house?: "))
14+
width = int(input("What's width of your house?: "))
15+
height = 8
16+
17+
# convertion to inchs
18+
length = (length*12)
19+
width = (width*12)
20+
height = (height*12)
21+
22+
23+
# perimeter
24+
perimeter = (2 * length) + (2 * width)
25+
26+
# walls of the basement
27+
Volume1 = (length) * (width) * (height)# needs to be 400
28+
Volume2 = (length + 16) * (width + 16) * (height)
29+
Volume = (Volume2-Volume1)
30+
31+
# floor of the basement
32+
floor_Volume = ((length*width)*4)
33+
34+
# footers of the basement
35+
footer_Volume1= (length + 24) + (width + 24)
36+
footer_Volume2= (length - 24) + (width - 24)
37+
footer_Volume = ((footer_Volume1 - footer_Volume2)*8)
38+
39+
# convertion to feet
40+
perimeter = perimeter/12
41+
Volume = Volume/1728
42+
footer_Volume = footer_Volume/8
43+
floor_Volume = floor_Volume/1728
44+
45+
# convertion to yards
46+
Volume = Volume/27
47+
footer_Volume = footer_Volume/27
48+
floor_Volume = floor_Volume/27
49+
Volume = round(Volume, 2)
50+
footer_Volume = round(footer_Volume, 2)
51+
floor_Volume = round(floor_Volume, 2)
52+
53+
# Total concrete calculation
54+
Total_cost_concrete = ((Volume + footer_Volume)* 150)
55+
Total_cost_concrete = round(Total_cost_concrete, 2)
56+
"""
57+
Part two- Sasha
58+
"""
59+
60+
61+
length_joist = 16
62+
width_joist = 2
63+
heigt_joist = 10
64+
65+
length_of_house = length
66+
distance = (length_of_house - 1.5)
67+
number_of_joists = distance / 16
68+
number_of_joists = round(number_of_joists)
69+
70+
joistrow = (width) / (16)
71+
joistrow = round(joistrow)
72+
total_joist = (joistrow) * (number_of_joists)
73+
74+
cost_joist = number_of_joists * 24.07
75+
cost_joist = round (cost_joist, 2)
76+
77+
78+
"""
79+
Part two- Keegang
80+
"""
81+
length_internal = (length / 12) - 0.75 #These 2 lines subtract half of the length of one stud from both the length and the width. This is so they're not just sticking half out of the wall.
82+
width_internal = (width / 12) - 0.75
83+
84+
perimeter_feet = (length_internal * 2) + (width_internal * 2) #Get perimeter in linear feet
85+
perimeter_in_inches = perimeter_feet * 12 #Convert perimeter to completely in inches
86+
87+
studs = 0; # Defining studs variable
88+
while perimeter_in_inches > 16: #Calculates number of studs
89+
perimeter_in_inches = perimeter_in_inches - 16
90+
studs = studs + 1
91+
studs = studs + 4 #Adding 1 stud for every corner. This is, of course, assuming it's just a square.
92+
93+
cost_studs = studs * 2.72 #Calculates cost
94+
cost_studs = round(cost_studs, 2)
95+
96+
#PRINTS PRINTS PRINTS
97+
#CHEMAI PRINTS
98+
print (" ")
99+
print ("The perimeter of your house is: " + str(perimeter) + (" ."))
100+
print ("The Volume of the wall is: " + str(Volume) + (" Cubic yard."))
101+
print ("The Volume of the footer is: " + str(footer_Volume) + (" Cubic yard."))
102+
print ("The Volume of a concrete floor for your basement is: " + str(floor_Volume) + (" Cubic yards."))
103+
print (" ")
104+
print ("Total Cost of concrete: " + str(Total_cost_concrete)+ "$" )
105+
#SASHA PRINTS
106+
print ("The total number of joists needed is " + str(number_of_joists))
107+
print ("Total cost of joists: " + str(cost_joist) + "$")
108+
#KEEGAN PRINTS
109+
print("\nNumber of studs: " + str(studs)) #Prints studs
110+
111+
print("Total cost of studs: $" + str(cost_studs))#Prints costs
112+
113+
cost_of_everything = cost_joist + cost_studs + Total_cost_concrete
114+
print("\n\nTotal cost altogether: " + str(cost_of_everything) + "$!")

0 commit comments

Comments
 (0)