180k views
11 votes
A person buys a product from XYZ shop. You have to input quantity of a product and price of one product. Provide 10 percent discount on bill, display bill before discount, amount discounted and bill after discount. Write pseudo code algorithm to process the requirement.

User Niki
by
3.3k points

1 Answer

8 votes

Answer:

The pseudocode algorithm is as follows:

  1. Start
  2. Input Quantity
  3. Input Price
  4. Bill = Quantity * Price
  5. Discount = 0.10 * Bill
  6. Display "Before Discount: "+bill
  7. Display "Discount: "+discount
  8. Display "After Discount: "+(bill - discount)
  9. Stop

Step-by-step explanation:

This begins the algorithm

Start

First, get input for quantity

Input Quantity

Then, get input for price

Input Price

Calculate the total bill (before discount)

Bill = Quantity * Price

Calculate discount

Discount = 0.10 * Bill

Print the total bill (before discount)

Display "Before Discount: "+bill

Print the discounted amount

Display "Discount: "+discount

Print the total bill (after discount)

Display "After Discount: "+(bill - discount)

End of algorithm

Stop

User Somi
by
3.2k points