69.2k views
1 vote
create a function that calculates the reduced price of a sale item, in which the inputs are the original price and the 20 iscount.

User Shahjapan
by
8.6k points

1 Answer

3 votes

Final answer:

To calculate the reduced price with a 20% discount, convert the discount to a decimal, multiply it by the original price, then subtract the result from the original price to get the reduced price.

Step-by-step explanation:

Calculating Reduced Price of a Sale Item

To calculate the reduced price of an item on sale with a 20% discount, follow these steps:


  1. Convert the discount percentage to a decimal by dividing it by 100. For a 20% discount, this would be 0.20.

  2. Multiply the original price by the discount rate to find the amount of the discount. For example, if the original price is $50.00, then the discount amount would be $50.00 x 0.20 = $10.00.

  3. Subtract the discount amount from the original price to get the reduced price. So, $50.00 - $10.00 = $40.00.

Your sale item will be reduced to the new price after applying the discount.

User Rishabh Maurya
by
7.9k points