Q. 'Kumar Electronics' has announced the following seasonal discounts on purchase of
certain items.
Purchase Amount Discount on Laptop Discount on Desktop PC
Up to Rs 25000 0.0% 5.0%
Rs 25,001 to Rs 50,000 5% 7.5%
Rs 50,001 to Rs 1,00,000 7.5% 10.0%
More than Rs 1,00,000 10.0% 15.0%
Write a program to input name, 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.
(Net amount = Amount of purchase - discount)
Answers
Answered by
16
Answer:
The program is very big hence I attached the photos. The second output I am typing as I can't attach more than 5 photos.
Output:
Enter your name
Rajat Joshi
Enter 'L to calculate the net amount of laptop
Enter 'D' to calculate the net amount of Desktop
Enter your choice
D
The type of purchase is desktop
Enter the amount of purchase
Name of the customer=Rajat Joshi
Net amount=67500
Note: I took ch as String value as it is giving me error if I use char .The full program is correct you can also check the output by solving.
Like I entered 50000 it gave me 47500
As 50000-5/100*50000
50000-2500
=Rs 47500
Hence,the program is correct.
Also check the sequence the first part of the program gone to the last just arrange the program.
Attachments:
Answered by
0
Answer:
https://link.knowledgeboat.com/27gW
Similar questions