A software company sells a package that retails for $99. Quantity discounts are
ID: 3669398 • Letter: A
Question
A software company sells a package that retails for $99. Quantity discounts are given according to the following table: Write a program that asks the user to enter the number of packages purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount. write the code solution for this in a tile named one.py. the input prompt string must be "Enter the number of packages purchased:". The program should accept an int value as number of packages. there should be two output description strings - one that describes the discount amount (first output) and the other that describes tire total amount (second output, on next line). The first string must be 'Discount Amount: S' and the second string must be Total Amount: $'. Note the dollar sign for both strings, which should precede the number getting printed since it is a money value. The money values must have exactly two digits alter the decimal (can be done by using the format function).Explanation / Answer
num = int(input("Enter number of packages: "))
if num > 9 && num < 20:
dis=(((num)*99)*10)/100
tot=(num*99)-dis
print("the discount is $",dis)
print the total price is $,tot)
elif num > 19 && num < 50:
dis=(((num)*99)*20)/100
tot=(num*99)-dis
print("the discount is $",dis)
print the total price is $,tot)
elif num > 49 && num < 100:
dis=(((num)*99)*30)/100
tot=(num*99)-dis
print("the discount is $",dis)
print the total price is $,tot)
elif num > 100:
dis=(((num)*99)*20)/100
tot=(num*99)-dis
print("the discount is $",dis)
print the total price is $,tot)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.