Robotics & Artificial Intelligence
Write a program in Python that accepts the name and price of a product and calculates the net amount to be paid by a customer, based on the following criteria:
| Product Price | Discount |
|---|---|
| <1000 | 0% |
| 1000-5000 | 2% |
| 5001-15000 | 3% |
| 15001-25000 | 5% |
| 25001-50000 | 10% |
| >50000 | 12% |
Answer
name = input("Enter product name: ")
price = float(input("Enter product price: "))
if price < 1000:
discount = 0
elif price <= 5000:
discount = 2 / 100
elif price <= 15000:
discount = 3 / 100
elif price <= 25000:
discount = 5 / 100
elif price <= 50000:
discount = 10 / 100
else:
discount = 12 / 100
discount_amount = price * discount
net_amount = price - discount_amount
print("Product Name:", name)
print("Original Price:", price)
print("Discount Amount:", discount_amount)
print("Net Amount to be Paid:", net_amount)Output
Enter product name: Mobile Phone
Enter product price: 20000
Product Name: Mobile Phone
Original Price: 20000.0
Discount Amount: 1000.0
Net Amount to be Paid: 19000.0
Related Questions
Draw the block diagram showing four degrees of freedom in a robot.
This branch of Artificial Intelligence allows machines to understand and interpret human language and speech.
a. Name the technology used here.
b. Mention two applications of this technology.
List different types of autonomous vehicles. Explain one type.
Discuss three benefits of integrating technology in medical and healthcare.