Question

In: Computer Science

A company sells a product for a retail price of $100. It offers quantity discounts based...

A company sells a product for a retail price of $100. It offers quantity discounts based on the table below

Quantity Discount

10-19

10%
20-49 20%
50-99 30%
100 or more 40%

Write a program that asks user for enter the quantity of product they want to purchase. It should then display the discount amount (if any) and the total purchase amount after the discount. The output should be displayed with 2 decimal points as shown below.

See a sample output

Enter the quantity of the product you want to purchase: 30
Discount Amount: $ 600.00
Total Purchase Amount: $ 2400.00

Refer the rubric and coding standards documents. Make sure you submit by 11:59 pm of the due date. Make sure you write the analysis/design algorithm along with properly documented code. Do not forget to attach your SDM as either another document or as a submission text when you submit your homework


PROGGRAMING LANGUAGE IS PYTHON

Solutions

Expert Solution

Source Code:

Output:

Code in text format (See above images of code for indentation):

#read quantity from user
quantity=int(input("Enter the quantity of the product you want to purchase: "))
#variables
discount=0
amount=0
#check for 10-19 and assign discount
if(quantity>=10 and quantity<20):
discount=0.10
#check for 20-49 and assign discount
elif(quantity>=20 and quantity<50):
discount=0.20
#check for 50-99 and assign discount
elif(quantity>=50 and quantity<100):
discount=0.30
#check for 100 or more and assign discount
elif(quantity>=100):
discount=0.40
#calculate discount amount
discount=discount*quantity*100
#calculate amount
amount=quantity*100-discount
#print discount and total amount
print("Discount Amount: $",round(discount,2))
print("Total Purchase Amount: $",round(amount,2))

'''
***********Algorithm******************
START
Read quantity from user
initialize discount and amount variables to 0
if quantity between 10-19 assign discount of 10% (0.1)
else if quantity between 20-49 assign discount of 20% (0.2)
else if quantity between 50-99 assign discount of 30% (0.3)
else if quantity 100 or more assign discount of 40% (0.4)
calculate discount as discount*quantity*100
calculate amount as quantity*100-discount
print discount and total amount and using round method print upto 2 decimal
END
******************************************
'''



Related Solutions

A distributor offers a price of $100 with discounts of 35% and 10%. What is the...
A distributor offers a price of $100 with discounts of 35% and 10%. What is the final price to the customer? -Answer suppose to be C, just need the calculations A. $50.75 B. $55.00 C. $58.50 D. $65.00
========================================================================= A software company sells a package that retails for $99. Quantity discounts are given according...
========================================================================= A software company sells a package that retails for $99. Quantity discounts are given according to the following table. Quantity Discount 10–19 20% 20–49 30% 50–99 40% 100 or more 50% Write a program that asks for the number of units sold and computes the total cost of the purchase. Input Validation: Make sure the number of units is greater than 0. ========================================================================= the pseudo code is: There comes situations in real life when we need to make some...
At a price of $4, quantity supplied is 100; and at a price of $6, quantity...
At a price of $4, quantity supplied is 100; and at a price of $6, quantity supplied is 120. Using the midpoint formula, compute the price elasticity of supply is and explain supply is elastic or inelastic. What is the elasticity of supply based on percentage method? Marks 4
Economic Growth (10 Marks) 2017 2018 Product Quantity Price Quantity Price Backpacks 100 $10 120 $12...
Economic Growth 2017 2018 Product Quantity Price Quantity Price Backpacks 100 $10 120 $12 Books 50 $15 40 $20 Using 2017 as a base year, calculate; 1) The GDP deflator 2) Nominal Economic growth 3) Real economic growth 4) Give reasons why Real GDP per capita may overstate the well-being of a countries inhabitants? make as per Canadian standards.                            
Economic Growth (10 Marks) 2017 2018 Product Quantity Price Quantity Price Backpacks 100 $10 120 $12...
Economic Growth 2017 2018 Product Quantity Price Quantity Price Backpacks 100 $10 120 $12 Books 50 $15 40 $20 Using 2017 as a base year, calculate; 1) The GDP deflator 2) Nominal Economic growth 3) Real economic growth 4) Give reasons why Real GDP per capita may overstate the well-being of a countries inhabitants?
Hogan Company uses the net method of accounting for sales discounts. Hogan offers trade discounts to...
Hogan Company uses the net method of accounting for sales discounts. Hogan offers trade discounts to various groups of buyers. On August 1, 2021, Hogan factored some accounts receivable on a without recourse basis. Hogan incurred a finance charge. Hogan also has some notes receivable bearing an appropriate rate of interest. The principal and total interest are due at maturity. The notes were received on October 1, 2021, and mature on September 30, 2022. Hogan’s operating cycle is less than...
Kimmel Company uses the net method of accounting for sales discounts. Kimmel also offers trade discounts...
Kimmel Company uses the net method of accounting for sales discounts. Kimmel also offers trade discounts to various groups of buyers. On August 1, 2017, Kimmel sold some accounts receivable on a without recourse basis. Kimmel incurred a finance charge. Kimmel also has some notes receivable bearing an appropriate rate of interest. The principal and total interest are due at maturity. The notes were received on October 1, 2017, and mature on September 30, 2019. Kimmel’s operating cycle is less...
Adams Company sells a single product. The product sells for $100 per unit. The company’s variable...
Adams Company sells a single product. The product sells for $100 per unit. The company’s variable expenses are 80% of sales and its fixed expenses total $150,000 per year. a: What is the company’s contribution margin ratio? b: What is the company’s break-even point? (Give answer in dollars and in units.)
The equilibrium price for a product is $58, and the quantity sold of the product is...
The equilibrium price for a product is $58, and the quantity sold of the product is 4060. The price elasticity of demand is -4.6, and the price elasticity of supply is 0.7. Find the demand curve and the supply curve for the product. (Your answer for the demand curve should be in the form Qd = a – bP, with specific numerical values given for a and b. Your answer for the supply curve should be in the form Qs...
The equilibrium price for a product is $32, and the quantity sold of the product is...
The equilibrium price for a product is $32, and the quantity sold of the product is 1280. The price elasticity of demand is -5.2, and the price elasticity of supply is 0.9. Find the demand curve and the supply curve for the product. (Your answer for the demand curve should be in the form Qd = a – bP, with specific numerical values given for a and b. Your answer for the supply curve should be in the form Qs...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT