محاسبه سود روزانه فروش بستنی

تمرین آسان 1139 visibility link download

برنامه‌ای بنویسید که به یک بستنی‌فروش امکان دهد با وارد کردن اطلاعات مربوط به هزینه‌ها و فروش روزانه، میزان سود حاصل از فروش بستنی‌ها را محاسبه کند. این برنامه باید از کاربر مقادیر زیر را دریافت نماید:

  • هزینه خرید یا ساخت نان بستنی
  • هزینه خرید یا ساخت خود بستنی
  • قیمت فروش هر بستنی به مشتریان
  • تعداد بستنی‌های فروخته شده در یک روز

سپس با استفاده از این داده‌ها، سود خالص روزانه را محاسبه و نمایش دهد. به عنوان مثال، اگر هزینه نان بستنی ۲ هزار تومان، هزینه بستنی ۵ هزار تومان، قیمت فروش هر بستنی ۱۰ هزار تومان و تعداد فروش ۲۰ عدد باشد، برنامه باید سود کل روز را به صورت عددی نمایش دهد.

این برنامه می‌تواند به بستنی‌فروش کمک کند تا به راحتی درآمد و سود روزانه خود را مدیریت و تحلیل نماید.

👨‍💻 8 ساعت قبل User 7716 این تمرین رو مشاهده کرد
👨‍💻 8 ساعت قبل User 7733 این تمرین رو مشاهده کرد
👨‍💻 1 ساعت قبل کاربر ناشناس این تمرین رو مشاهده کرد
🔥 8 ساعت قبل User 7733 جواب جدیدی برای این تمرین ارسال کرد

reply 8

Bread=input("enter your bread : ")
Bread=int(Bread)
Purchase_price=input("enter your Purchase price : ")
Purchase_price=int(Purchase_price)
Selling_price=input("enter your Selling price : ")
Selling_price=int(Selling_price)
One_day_sale=input("enter your One day sale : ")
One_day_sale=int(One_day_sale)
Profit=((Selling_price)-(Bread+Purchase_price))*One_day_sale
print(Profit)
def calculate_profit():
    cone_cost = float(input("Enter the cost of ice cream cone: "))
    ice_cream_cost = float(input("Enter the cost of ice cream: "))
    selling_price = float(input("Enter the selling price per ice cream: "))
    quantity_sold = int(input("Enter the number of ice creams sold: "))

    total_cost = (cone_cost + ice_cream_cost) * quantity_sold
    total_revenue = selling_price * quantity_sold
    profit = total_revenue - total_cost

    print("Daily profit:", profit)

calculate_profit()
ice_bread = int(input("How much does it cost? "))
ice_self = int(input("How much did you pay?"))
ice_price = int(input("How much did you sale for each?"))
ice_much = int(input("How many ice cream did you sale?"))

hazine_kharid = ice_bread + ice_self
forush = ice_price * ice_much
hazine_total = hazine_kharid * ice_much
soode_total = forush - hazine_total

print(soode_total)
def receive_fees():
    bread = None
    ice_cream = None
    while bread is None or ice_cream is None:
        if bread is None:
            try:
                bread = int(input('Enter the cost of bread :'))
                if type(bread) == int or type(bread) == float :
                    bread = bread 
            except (TypeError ,ValueError):
                print('You did not enter the information correctly')
                bread = None
                continue
        if ice_cream is None:
            try:
                ice_cream = int(input('Enter the cost of ice cream :'))
                if type(ice_cream) == int or type(ice_cream) == float:
                    ice_cream = ice_cream    
            except (TypeError ,ValueError):
                print('You did not enter the information correctly')
                ice_cream = None
                continue
        if bread != None and ice_cream != None:
            return bread ,ice_cream              
bread , ice_cream = receive_fees()  

def sales_profit(bread ,ice_cream ,price ,number_of_sales):
    costs = bread + ice_cream
    income = price * number_of_sales
    profit = income - costs
    print(profit)

def amount_of_sales_and_income():
    price = None
    number_of_sales = None
    while price is None or number_of_sales is None:
        if price is None:
            try:
                price = int(input('Enter the price of each ice cream :'))
                if type(price) == int or type(price) == float :
                    price = price 
            except (TypeError ,ValueError):
                print('You did not enter the information correctly')
                price = None
                continue
        if number_of_sales is None:
            try:
                number_of_sales = int(input('Enter the number of ice creams sold :'))
                if type(number_of_sales) == int or type(number_of_sales) == float:
                    number_of_sales = number_of_sales 
            except (TypeError ,ValueError):
                print('You did not enter the information correctly')
                number_of_sales = None
                continue
        if price != None and number_of_sales != None:
            sales_profit(bread ,ice_cream ,price ,number_of_sales)

amount_of_sales_and_income()

def profit(bread,ice_cream_cost,ice_cream_price,number_of_sales):
    cost = (bread + ice_cream_cost)*number_of_sales
    sold = ice_cream_price * number_of_sales
    return sold - cost

bread_cost = int(input("bread cost(toman): "))
ice_Cream_cost = int(input("Ice cream cost(toman): "))
Ice_Cream_price = int(input("Ice cream price(toman): "))
how_many_in_day = int(input("how many ice creams did you sell today: "))

print(f"total sale: {(Ice_Cream_price*how_many_in_day):,}\ntotal cost: {((bread_cost+ice_Cream_cost)*how_many_in_day):,} \ntoday's profit: {(profit(bread_cost,ice_Cream_cost,Ice_Cream_price,how_many_in_day)):,}")

#هزینه ی نون بستنی
bread = int(input("Enter the cost of making ice cream bread: "))
#هزینه ی بستنی
ice_creame = int(input("Enter the cost of making ice cream: "))
#قیمت فروش
price = int(input("Enter ice cream price: "))
#تعداد فروش
sales = int(input("Enter the number of sales: "))

#محاسبه ی سود
profit = (price - (bread + ice_creame)) * sales

#نمایش به کاربر
print("-----------------------")
print("your profit-->",profit)

reply ارسال جواب

  • قبل از ارسال جواب ویدیو زیر رو ببین تا کار کردن با markdown رو یاد بگیری
  • لطفا جواب های تکراری ارسال نکن
  • در متن جواب اطلاعات شخصی شامل ایمیل و شماره موبایل و آی دی و... ننویس
  • سعی کن داخل کدت از کلمات فارسی یا فینگلیش (فارسی با حروف انگلیسی) استفاده نکنی و کدت تماما انگلیسی باشه
  • لطفا داخل جواب از ایموجی یا کاراکترهای خاص استفاده نکن
  • ارسال جواب حق مادی یا معنوی برای ارسال کننده ایجاد نمیکند و تمام حقوق برای سایت کدبزن محفوظ است

راهنمای ارسال جواب 👇

×
بستن