An electronic shop has announced the followed seasonal discounts on the purchase of certain
items.
PURCHASE AMOUNT IN RS. DISCOUNT ON LAPTOP DISCOUNT ON DESKTOP
0-25000 0.0% 5.0%
25001-57000 5.0% 7.5%
57001-100000 7.5% 10.0%
More than 100000 10.0% 15.0%
Write a menu driven program to input name, amount of purchase and type of purchase (1 for
Laptop and 2 for Desktop) by the customer. Compute and print the net amount to be paid by the
customer along with her name and address. (Net amount=amount of purchase- discount)
Answers
The following cσdes have been written using Python.
while True:
print("1. Compute your net amount.")
print("2. Exit.")
print()
c = int(input("Enter your choice: "))
print()
if c == 1:
n = input("Enter your name: ")
a = float(input("Enter your amount of purchase: "))
print()
print("1. Laptop")
print("2. Desktop")
print()
tp = int(input("Enter the type of purchase: "))
print()
if tp == 1:
if a >= 0 and a <= 25000:
d = 0/100
na = a - (a*d)
print(n, "your net amount to be paid is: ", na)
print()
elif a >= 25001 and a <= 57000:
d = 5/100
na = a - (a*d)
print(n, "your net amount to be paid is: ", na)
print()
elif a >= 57001 and a <= 100000:
d = 7.5/100
na = a - (a*d)
print(n, "your net amount to be paid is: ", na)
print()
elif a > 100000:
d = 10/100
na = a - (a*d)
print(n, "your net amount to be paid is: ", na)
print()
elif tp == 2:
if a >= 0 and a <= 25000:
d = 5/100
na = a - (a*d)
print(n, "your net amount to be paid is: ", na)
print()
elif a >= 25001 and a <= 57000:
d = 7.5/100
na = a - (a*d)
print(n, "your net amount to be paid is: ", na)
print()
elif a >= 57001 and a <= 100000:
d = 10/100
na = a - (a*d)
print(n, "your net amount to be paid is: ", na)
print()
elif a > 100000:
d = 15/100
na = a - (a*d)
print(n, "your net amount to be paid is: ", na)
print()
elif c == 2:
break
Answer:
IJHHI
Explanation:
A Shoe showroom has announced the following seasonal discounts on purchase of items:
Amount Leather items (%) Others(%)
0 – 100 2 3
101 - 200 3 4
201 – 300 5 6
Above 300 7 8
Write a program using if statements to compute the net amount to be paid by customer.
Net= amount- discountA Shoe showroom has announced the following seasonal discounts on purchase of items:
Amount Leather items (%) Others(%)
0 – 100 2 3
101 - 200 3 4
201 – 300 5 6
Above 300 7 8
Write a program using if statements to compute the net amount to be paid by customer.
Net= amount- discountA Shoe showroom has announced the following seasonal discounts on purchase of items:
Amount Leather items (%) Others(%)
0 – 100 2 3
101 - 200 3 4
201 – 300 5 6
Above 300 7 8
Write a program using if statements to compute the net amount to be paid by customer.
Net= amount- discountA Shoe showroom has announced the following seasonal discounts on purchase of items:
Amount Leather items (%) Others(%)
0 – 100 2 3
101 - 200 3 4
201 – 300 5 6
Above 300 7 8
Write a program using if statements to compute the net amount to be paid by customer.
Net= amount- discountA Shoe showroom has announced the following seasonal discounts on purchase of items:
Amount Leather items (%) Others(%)
0 – 100 2 3
101 - 200 3 4
201 – 300 5 6
Above 300 7 8
Write a program using if statements to compute the net amount to be paid by customer.
Net= amount- discountA Shoe showroom has announced the following seasonal discounts on purchase of items:
Amount Leather items (%) Others(%)
0 – 100 2 3
101 - 200 3 4
201 – 300 5 6
Above 300 7 8
Write a program using if statements to compute the net amount to be paid by customer.
Net= amount- discountA Shoe showroom has announced the following seasonal discounts on purchase of items:
Amount Leather items (%) Others(%)
0 – 100 2 3
101 - 200 3 4
201 – 300 5 6
Above 300 7 8
Write a program using if statements to compute the net amount to be paid by customer.
Net= amount- discountA Shoe showroom has announced the following seasonal discounts on purchase of items:
Amount Leather items (%) Others(%)
0 – 100 2 3
101 - 200 3 4
201 – 300 5 6
Above 300 7 8
Write a program using if statements to compute the net amount to be paid by customer.
Net= amount- discountA Shoe showroom has announced the following seasonal discounts on purchase of items:
Amount Leather items (%) Others(%)
0 – 100 2 3
101 - 200 3 4
201 – 300 5 6
Above 300 7 8
Write a program using if statements to compute the net amount to be paid by customer.
Net= amount- discountA Shoe showroom has announced the following seasonal discounts on purchase of items:
Amount Leather items (%) Others(%)
0 – 100 2 3
101 - 200 3 4
201 – 300 5 6
Above 300 7 8
Write a program using if statements to compute the net amount to be paid by customer.
Net= amount- discountA Shoe showroom has announced the following seasonal discounts on purchase of items:
Amount Leather items (%) Others(%)
0 – 100 2 3
101 - 200 3 4
201 – 300 5 6
Above 300 7 8
Write a program using if statements to compute the net amount to be paid by customer.
Net= amount- discountKD;LF GH DRG