USING PYTHON: A software company sells a package that retails for $99. Quantity discount are given as follows: Quantity Discount ___________________________________ 10 - 19 10% 20 - 49 20% 50 - 99 30% 100 or more 40% 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 discount. Hints: Declare constant variable for retail_price = 99 Declare local variable, quantity, fullprice, dicountedrate etc Prompt the user to get quantity Write an if/elif statement to calculate the discount Calculate the fullprice Calculate the discountAmount Calculate totalamount Display discountAmount and totalamount Expected output: If the number of packages purchased entered by the User is 20, it should display the results as follows: Discount Amount: $ 396.00 Total Amount: $ 1584.00
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
USING PYTHON:
A software company sells a package that retails for $99. Quantity discount are given as follows:
Quantity Discount
___________________________________
10 - 19 10%
20 - 49 20%
50 - 99 30%
100 or more 40%
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 discount.
Hints:
Declare constant variable for retail_price = 99
Declare local variable, quantity, fullprice, dicountedrate etc
Prompt the user to get quantity
Write an if/elif statement to calculate the discount
Calculate the fullprice
Calculate the discountAmount
Calculate totalamount
Display discountAmount and totalamount
Expected output:
If the number of packages purchased entered by the User is 20, it should display the results as follows:
Discount Amount: $ 396.00
Total Amount: $ 1584.00
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images