Ask Question
16 February, 15:20

Can you find the reason that the following pseudocode function does not return the value indicated in the comments? / / The calcDiscountPrice function accepts an item's price and / / the discount percentage as arguments. It uses those / / values to calculate and return the discounted price. Function Real calcDiscountPrice (Real price, Real percentage) / / Calculate the discount. Declare Real discount = price * percentage / / Subtract the discount from the price. Declare Real discountPrice = price - discount / / Return the discount price. Return discount End Function

+1
Answers (1)
  1. 16 February, 18:16
    0
    see explaination

    Explanation:

    Function Real calcDiscountPrice (Real price, Real percentage) / / Calculate the discount.

    Declare Real discount = (price * percentage) / 100.0 / / Subtract the discount from the price.

    //dividing by 100.0 because of % concept

    Declare Real discountPrice = price - discount / / Return the discount price.

    Return discount End Function
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Can you find the reason that the following pseudocode function does not return the value indicated in the comments? / / The ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers