Information Technology IT – 4 Algorithms and flowcharts | e-Consult
4 Algorithms and flowcharts (1 questions)
Login to see all questions.
Click on a question to view the answer
Algorithm:
- Start
- Get the customer's spending amount (let's call it
amount). - If
amount> 50 then:- Calculate the discount amount:
discount = amount * 0.10 - Calculate the final price:
final_price = amount - discount
- Calculate the discount amount:
- Else If
amount>= 20 andamountthen:- Calculate the discount amount:
discount = amount * 0.05 - Calculate the final price:
final_price = amount - discount
- Calculate the discount amount:
- Else:
final_price = amount
- End (Output:
final_price)
Pseudocode:
START
INPUT amount
IF amount > 50 THEN
discount = amount * 0.10
final_price = amount - discount
ELSE IF amount >= 20 AND amount