CodeSolved

Solved Programming Questions & Exercises

Calculate the daily profit of ice cream sales

Practice Easy 2113/ Download 1138 Views

Write a program that allows an ice cream seller to calculate the amount of interest from the sale of ice cream by entering the cost and daily sales information. This program must receive the following values ​​from the user:

  • Cost of buying or making ice cream bread
  • The cost of buying or building your own ice cream
  • The sale price of any ice cream to customers
  • The number of ice cream sold in a day

Then, using this data, calculate and display the daily net profit. For example, if the cost of ice cream bread is 4,000 tomans, the cost of ice cream of 4,000 tomans, the price of the ice cream is 2 thousand tomans and the number of sales is 2, the program should display the entire day's profit.

The program can help the ice cream shop easily manage and analyze its daily income and profit.

8 Answers

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()
Ai Download Python
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)
User 5798 Download Python
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)):,}")

# The cost of ice cream bread
bread = int(input("Enter the cost of making ice cream bread: "))
# The cost of ice cream
ice_creame = int(input("Enter the cost of making ice cream: "))
# Selling price
price = int(input("Enter ice cream price: "))
# Number of sales
sales = int(input("Enter the number of sales: "))

# Profit calculation
profit = (price - (bread + ice_creame)) * sales

# Display to the user
print("-----------------------")
print("your profit-->",profit)

Ar249 Download Python
make_a_ice_cream_bread= int(input("cost1:"))
make_a_ice_cream= int(input("cost2:"))
price= int(input("sell:"))
number= int(input("how many sell?"))
cost= make_a_ice_cream+make_a_ice_cream_bread
profit= price-cost
all_profit= profit*number
print(f"all:{all_profit}")
bread = int(input("cost of bread: "))
ice_cream = int(input("cost of making ice cream: "))
sell = int(input("price of selling ice cream : "))
number = int(input("number of sell per day: "))
cal = number * (sell - (bread + ice_cream))
print(f"the profit of this day is {cal}")
User 5786 Download Python

Submit answer

Submitting answers is currently unavailable.

×
×
Close