CodeSolved

A comprehensive source of programming questions and exercises

Calculate the seller's rights

Practice Easy 1327/ Download 669 Views

Write a program that receives the number of goods sold by the seller and calculates and prints his / her rights based on the following formula:

Each seller receives 1 USD for the first commodity for selling
If the number of goods sold is more than 1, it will receive 2 USD per additional product

22 Answers

This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
def mohasebe_hoghogh(kala):
    if kala <= 50:
        return kala * 20000
    elif kala > 50:
        ezafe = kala - 50
        kala = 50
        return (kala * 20000)+(ezafe * 40000)
while 1:
    try: 
        kala = int(input('tedad kalaye frokhte shode: '))
        print(f"hoghogh shoma dar in mah: {mohasebe_hoghogh(kala)}")
        break
    except:
        print('adad vared konid')
Tedad_kala = int(input("Kala: "))
if Tedad_kala <= 50:
    print(Tedad_kala * 20000) 
else:print((Tedad_kala - 50) * 40000 + 1000000)
User 658 Download Python
num = int(input("hoghooghe forooshandeh:"))
if num > 50 :
    num1 = num - 50
    print ("hoghoogh forooshandeh:" , 50 * 20000 + num1 * 40000)
    print ("movafagh bashid")
if num < 50 :
    print ("hoghooghe forooshandeh:" , num * 20000)
    print ("movafagh bashid")
Arad.fani Download Python
kar =int(input(" kala:")
a=[]
b=[]
for i in reange(kar):
    if kar <= 50:
        a.append(kar)
        print(sum(a)×2000))
    elif  kar >= 51:
        b.append(kar)
        print(sum(b)×4000))

Unfortunately it is wrong Amirhn


num_sell = int(input("Pleasr enter num of: "))
if num_sell <= 50:
    salary = num_sell * 20000
else:
    salary = (num_sell * 40000) - 1000000
print(f"salary = {salary}")
Behcoder Download Python
tk=int(input("num kala:"))
if tk<51:
    salary=tk*20000
else:
    salary=tk*40000
print("salary:",salary)
User 489 Download Python

Unfortunately not true. You realized the question wrong. Amirhn


def calculation_seller_rights(num_goods):
    while True:
        if num_goods > 0 and num_goods <= 50:
            print(f"Number of goods: {num_goods}\nAmount received: {num_goods * 20000} Toman")
        elif num_goods > 50:
            print(f"Number of goods: {num_goods}\nAmount received: {num_goods * 40000} Toman")
        else:
            print("Please enter the correct product number!!")
            calculation_seller_rights(int(input("Enter the number of goods: ")))
        break
calculation_seller_rights(int(input("Enter the number of goods: ")))

It doesn't seem right. Do not match the question. Amirhn


<< Previous page 1 2 3 Next page >>

Submit answer

Submitting answers is currently unavailable.

×
×
Close