AyeshaAslam commited on
Commit
b3a62c5
·
verified ·
1 Parent(s): 55c9520

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -0
app.py CHANGED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+
3
+ # Title and Description
4
+ st.title("Brick Masonry Estimator")
5
+ st.write("""
6
+ This app estimates the number of bricks and mortar required to construct a wall based on the wall dimensions and brick size.
7
+ """)
8
+
9
+ # Input Fields
10
+ st.header("Input Wall Dimensions and Brick Size")
11
+ wall_length = st.number_input("Wall Length (meters)", min_value=0.0, step=0.1, value=5.0)
12
+ wall_height = st.number_input("Wall Height (meters)", min_value=0.0, step=0.1, value=3.0)
13
+ brick_length = st.number_input("Brick Length (cm)", min_value=0.0, step=0.1, value=20.0)
14
+ brick_height = st.number_input("Brick Height (cm)", min_value=0.0, step=0.1, value=10.0)
15
+
16
+ # Calculation
17
+ if st.button("Calculate"):
18
+ # Convert dimensions to consistent units (meters to centimeters)
19
+ wall_area = wall_length * wall_height * 10000 # m² to cm²
20
+ brick_area = brick_length * brick_height # cm²
21
+
22
+ if brick_area > 0:
23
+ total_bricks = wall_area / brick_area
24
+ mortar_percentage = 0.10 # Assume 10% of volume is mortar
25
+ mortar_volume = (wall_length * wall_height * 0.2) * mortar_percentage # Assuming 20cm wall thickness
26
+
27
+ # Output
28
+ st.subheader("Results")
29
+ st.write(f"**Total Bricks Required:** {int(total_bricks)} bricks")
30
+ st.write(f"**Mortar Volume Required:** {round(mortar_volume, 2)} cubic meters")
31
+ else:
32
+ st.error("Brick dimensions must be greater than 0.")
33
+
34
+ # Footer
35
+ st.write("---")
36
+ st.write("Created by: [Your Name]")