Political Science, asked by subhasiskun2020, 5 months ago

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 mad210203
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:

  1. Start
  2. Declare an array of size 5 of type float
  3. Read the prices of 5 items
  4. Multiply 0.05 to all elements of the array
  5. Add all the elements of the array and store it in the variable total
  6. Print total
  7. Stop
Similar questions