تمرین برنامه نویسی؛ با کدبزن!

منبع جامع سوالات و تمرینات برنامه نویسی

3
+1
+1
+1

محاسبه تخفیف

Hossein آسان 114/ دانلود 2262 بازدید

لیستی از اجناس مختلف به همراه درصد تخفیف آنها داریم و میخواهیم بدانیم قیمت نهایی هر محصول بعد از لحاظ کردن تخفیف چقدر میشود.

برنامه ای بنویسید که همانند زیر قیمت محصول و درصد تخفیف آن را دریافت کند و قیمت نهایی و مقدار تخفیف را در خروجی چاپ کند.

تا وقتی کاربر عدد 0 وارد نکرده است برنامه باید ادامه یابد


gheymat mahsool: 10000000
darsad takhfif: 20

gheymat nahaei = 8000000
takhfif = 2000000

28 جواب

نمیتونم این تمرین رو حل کنم!
0
while True:

 price = float(input("Enter mineral price:"))
 discount = float(input("Enter discount_price of mineral:"))

 txt = input("1.discounted 2.final_price 3.exit\n")

 if txt == "1":
    All_1 = ( price * discount ) / ( 100 )
    print( "discount is" , All_1 ) ;
    txt = input("Do you want to continuation(y|N)\n")
    if txt == "y":
        txt = input("1.discounted 2.final_price 3.exit\n")
        print( "final_price is",price - All_1 )
        txt = input("Do you want to continuation(y|N)\n")
        if txt == "y":
            txt = input("1.discounted 2.final_price 3.exit\n")
        else:
           if txt == "3":
            print("Good bye:)")
            break
کاربر 775 دانلود Python
0
gheymat = int ( input ( "First Gheymat : "))
Takhfif = int ( input ( "Takhfif : " ) )

print ( "You paid {} and don't pay {}" . format ( gheymat - (gheymat * ( Takhfif / 100 ) ) , gheymat * ( Takhfif / 100 ) ) )
Kian1390 دانلود Python
0
num = int(input('num: '))
ta = int(input())
print(num-(num * ta / 100))
print(num * ta / 100)
Amirhosein دانلود Python
0
while True:
    product_price = float(input("Enter price of the product(to exit print(0) ) : "))
    if product_price == 0:
        break
    
    product_discount = float(input("Enter discount of product : "))
     
    discount_amont = product_price * product_discount/100
    final_price = product_price-discount_amont
    print (".............................................")
    print ("product_price :" , product_price)
    print ("product_discount :" , product_discount)
    print (".............................................")
    print ("discount_amont :" , discount_amont )
    print ("final_price : " , final_price)
    print ("...............................................")
Tadashi دانلود Python
0
a=float(input("gheymat:"))
b=float(input("darsad takhfif:"))
print("gheymat nahaii=" , a-(a*(b/100)))
print("takhfif=" , a*(b/100))
Mm000 دانلود Python
0
while True:
    a=int(input("gheimate kala...>"))
    b=float(input("darsade takhfif...>"))
    c=a*b
    d=a-c
    print(d)
    if a==0:
        break
Mary12 دانلود Python
0
while True:
    mahsol = input('1.poshak :  ')
    if mahsol == '1':
        price =int (input("price : "))
        off =int (input("off : "))
        print(price * off / 100)


    if mahsol=='0':
        break
print (mahsol)        
Farshad10 دانلود Python
0
while True:
    
    a=float(input("ghimat mahsool:"))
    if a==0:
        break
    b=float(input("drsad takhfif:"))
    c=a*b/100
    d=a-c
    print("ghimat nahai mahssol:",int(d))
    print("takhfif:",int(c))
کاربر 1991 دانلود Python
0
while True :
    price=float(input('price : '))
    if price==0:
        break
    disc= float(input('discount : '))
    
    print('price with discount : {}'.format(price*(1-(disc/100))))
Soheyl دانلود Python
0
while True:
  ghei=int(input('gheimat:'))
  if ghei==0 :break
  takhfif=int(input("takhfif:"))
  if takhfif==0 :break
  d=int(takhfif*ghei/100)
  o=ghei-d
  print(o)   
Amirrafei76 دانلود Python
<< صفحه قبل 1 2 3 صفحه بعد >>

ارسال جواب

/* کداتو توی این بخش بنویس
فرقی نمیکنه چه زبان برنامه نویسی باشه، همرو پشتیبانی میکنیم :)
البته قبلش این سه خط رو پاک کن */
                    
  • لطفا جواب های تکراری ارسال نکن
  • قبل از ارسال، جوابت رو داخل یک کد ادیتور مثل vscode بنویس و بعد اینجا Paste کن
  • جواب های ارسالی، پس از بررسی کوتاهی، ویرایش میشن و در سایت نمایش داده میشن
  • ارسال جواب حق مادی یا معنوی برای ارسال کننده ایجاد نمیکند و تمام حقوق برای سایت کدبزن محفوظ است

تمرینات مرتبط

تشخیص با استفاده از هوش مصنوعی
×
×
بستن