This program will ask a user for a unit price and quantity. It will then multiply the unit price by the quantity. If quantity is greater than 10, put in a 5% discount. If quantity is greater than 100, put in a 10% discount.
def bmth(unit, quan):
def computeN(unit, quan):
z = unit * quan
print(z)
if 10 <= quan < 99:
ordercost = unit * quan
discfive = ordercost * .05
v = ordercost - discfive
print('Your original price was ', ordercost)
print('You Saved', discfive, 'off')
print('Your new price is now ', v)
elif quan >= 100:
ordercost2 = unit * quan
discten = ordercost2 * .10
n = ordercost2 - discten
print('Your original price was ', ordercost2)
print('You save ', discten, 'off')
print('Your new price is now ', n)
else:
computeN(unit, quan)
while True:
unit = float(input('Enter the Unit price: '))
quan = int(input('Enter your items: '))
onelasttime = input('Do you wish to continue? Y or N: ')
Y = bmth(unit, quan)
if onelasttime:
input(Y)
elif onelasttime:
input(N)
break