01. Write down the algorithm to input the price of 5 items. Apply the discount of 5% on
every item and print the total amount need to be paid by the customer. [5]
Answers
Answered by
1
Algorithm is given below.
Explanation:
- Algorithm is a step by step to solve a program or a problem.
- Algorithm helps a programmer to write programs.
- Here, we need to write a algorithm to input price of 5 items and apply a discount of 5% on every item and print the total amount.
Steps for algorithm:
- Start
- Declare an array of size 5 of type float
- Read the prices of 5 items
- Multiply 0.05 to all elements of the array
- Add all the elements of the array and store it in the variable total
- Print total
- Stop
Similar questions