# might 26th, 2010
# CS110
# Amanda L. Moen
# 5. Software program Sales
# A software company sells a package the retails for $99.

You are watching: A software company sells a package that retails for $99

# amount discounts are provided according to the following table:
# quantity Discount
# 10-19 20%
# 20-49 30%
# 50-99 40%
# 100 or much more 50%
# write a program that asks the user to get in the variety of packages
# purchased. The program need to then display screen the amount of the
# discount (if any) and the total amount the the acquisition after the
# discount.
def main():
# questioning the user to enter the number of packages purchased.
quantity = input('Enter the variety of packages purchased: ')
# determine the discount percentage.
if amount 10:
publish 'No discount.'
discount=1.0
elif amount 20:
publish 'Your discount is 20%.'
discount=0.8
elif amount 50:
print 'Your discount is 30%.'
discount=0.7
elif quantity 100:
print 'Your discount is 40%.'
discount=0.6
else:
publish 'Your discount is 50%.'
discount=0.5
# specify 'total'
total(quantity, discount)
def total(quantity, discount):
# with no discount each package the software expenses $99.00.

See more: Adele 60 Minutes Australia, Adele Debuts 'When We Were Young'

# calculate the total price through the discount
total_amount = amount * discount * 99.0
# calculation the complete price prior to the discount
full_price = amount * 99.0
print 'The amount of your discount is ', full_price - total_amount
publish 'Your full purchase price is ', total_amount
# contact the key function.
main()
Copy currently Copy permalink
go
© 2021 couchsurfingcook.com, Inc.
girlfriend can’t execute that activity at this time.
friend signed in with one more tab or window. Reload come refresh your session. You signed out in another tab or window. Reload come refresh your session.