Exercise: Discounted Price
Learn to make a price discounting system.
We'll cover the following
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:
If the
price
is300
or above, there will be a30%
discount.If the
price
is between200
and299
(200
inclusive), there will be a20%
discount.If the
price
is between100
and199
(100
inclusive), there will be a10%
discount.If the
price
is less than100
, there will be a5%
discount.
Get hands-on with 1400+ tech skills courses.