حاسبة الجبس بورد
def calculate_cost(prices, quantities):
total_cost = 0
for item, quantity in quantities.items():
if item in prices:
total_cost += prices[item] * quantity
return total_cost
# أسعار المواد
prices = {
"الأبيض كناوف 12.5 مم": 300.00,
"الأبيض كناوف 9.5 مم": 240.00,
"الأحمر كناوف 12.5 مم": 450.00,
"الأخضر كناوف 12.5 مم": 385.00,
"الأبيض جي بورد 12.5 مم": 275.00,
"الأخضر جي بورد 12.5 مم": 355.00,
"الأحمر جي بورد 12.5 مم": 355.00,
"أوميغا 2.0": 30.50,
"أوميغا 2.5": 35.50,
"أوميغا 3.0": 26.60,
"أوميغا 3.5": 41.50,
"زاوية 3.0": 15.25,
"زاوية 3.5": 17.75,
"زاوية 4.0": 26.50
}
# إدخال الكميات المطلوبة من المستخدم
quantities = {}
print("أدخل الكمية المطلوبة لكل صنف (اكتب 0 إذا لا تحتاج لهذا الصنف):")
for item in prices.keys():
try:
quantity = float(input(f"{item}: "))
quantities[item] = quantity
except ValueError:
print("الرجاء إدخال رقم صحيح.")
quantities[item] = 0
# حساب التكلفة الإجمالية
total_cost = calculate_cost(prices, quantities)
print(f"\nالتكلفة الإجمالية: {total_cost:.2f} جنيه")
تعليقات
إرسال تعليق