حالت آفلاین — محتوا از حافظهٔ کش نمایش داده می‌شود

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

تمرین آسان 2157 visibility link download flag

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

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

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

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

👨‍💻 8 ساعت قبل کاربر ناشناس این تمرین رو مشاهده کرد

reply 15

visibility
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)
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 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()
پاسخ هوش مصنوعی Ai Python
a = int(input("price of bread"))
b = int(input("price of ice cream"))
c = int(input("price of each ice cream you sell"))
d = int(input("the number of ice cream you sell everyday"))
print("your total earn for each day is =" ,\
      (c-(b+a))*d)
import java.util.Scanner;

public class IceCreamProfitCalculator {

    public static void calculateProfit() {
        Scanner scanner = new Scanner(System.in);

        System.out.print("Enter the cost of ice cream cone: ");
        double coneCost = scanner.nextDouble();

        System.out.print("Enter the cost of ice cream: ");
        double iceCreamCost = scanner.nextDouble();

        System.out.print("Enter the selling price per ice cream: ");
        double sellingPrice = scanner.nextDouble();

        System.out.print("Enter the number of ice creams sold: ");
        int quantitySold = scanner.nextInt();

        double totalCost = (coneCost + iceCreamCost) * quantitySold;
        double totalRevenue = sellingPrice * quantitySold;
        double profit = totalRevenue - totalCost;

        System.out.println("Daily profit: " + profit);

        scanner.close();
    }

    public static void main(String[] args) {
        calculateProfit();
    }
}
پاسخ هوش مصنوعی Ai Java
def SalesProfil(x,y,z,h):
    sell = x * y
    cost = z + h
    profil = sell - cost 
    print(profil)
while True:
    CostBread = int(input('enter the cost of ice ream bread :'))
    CostIceream = int(input('enter the cost of ice ream :'))
    selling = int(input('enter the selling price of each ice cream : '))
    number = int(input('enter the number of ice creams sold :'))
    SalesProfil(selling,number,CostBread,CostIceream)
# ICB = Ice cream bread
# IC = Ice cream
def profit(icb, ic, price, number): # greftan 4 vroodi ke meqdar sood ro hesab mikone
    profit = (price-(icb + ic)) * number
    return profit

icb = int(input("Hazine Noonebastani = ")) # hazine kharid noon bastani
ic = int(input("Hazine bastani = ")) # hazine kharid bastani
price = int(input("Qeimat Froosh = "))  # qemat frooshe bastani ha
number = int(input("Che tedad frookhti? ")) # vroodi tedad froosh bastani

print(f"sood shoma = {profit(icb, ic, price, number)} \n be tedad = {number}")



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)

<< صفحه قبل 1 2 صفحه بعد >>

ارسال جواب

جوابت را با Markdown بنویس و ثبت کن

×
بستن