Exercise: Discounted Price

Learn to make a price discounting system.

Problem statement

Create a system that applies discounts to product prices based on their value. The purpose of this system is to incentivize customers to make larger purchases by offering increasing discounts for higher price ranges. By implementing these discount rules:

  1. If the price is 300 or above, there will be a 30% discount.

  2. If the price is between 200 and 299 (200 inclusive), there will be a 20% discount.

  3. If the price is between 100 and 199 (100 inclusive), there will be a 10% discount.

  4. If the price is less than 100, there will be a 5% discount.

Get hands-on with 1400+ tech skills courses.