A shop has announced the following seasonal discounts on the purchase of certain items:
PURCHASE AMOUNT IN RS.
DISCOUNT ON LAPTOP
DISCOUNT ON DESKTOP PC
0 – 25000
0.0%
5.0%
25001 – 57000
5.0%
7.6%
57001 – 100000
7.5%
10%
More than 100000
10.0%
15.0%
Write a program based on the above criteria to input name, address, amount of purchase and the type of purchase (L for Laptop and D for Desktop) by a customer. Compute and print the net amount to be paid by a customer along with his name and address.
Hint:
(1) Discount = (discount rate / 100) * amount of purchase, Net amount = amount of purchase – discount)
(2) String str=sc.next().charAt(0) takes the first character from String “Laptop”
Answers
Answered by
1
Answer:
Write a program based on the above criteria, to input name, address, amount of purchase and the type of purchase (L for Laptop and D for Desktop) by a customer. Compute and print the net amount to be paid by a customer along with his name and address. (Hint : discount = (discount rate! 100)* amount of purchase Net amount = amount of purchase – discount)
Similar questions