Home Top Ad

ALGORITHM



Algorithm is “an effective procedure for solving a problem in finite number of steps”. The instruction cannot assume anything, cannot skip steps, must be executable one step at a time and must be completed.

A programmer must ensure the algorithm for the problem is correct and in correct order before proceeding to the next phase; create pseudo code and flowchart.



Here is an example of an algorithm, for making a pot of tea.



1.       If the tea pot is not empty, empty the tea pot.

2.       Place tea leaves in tea pot.

3.       If the kettle does not contain water, the fill the kettle.

4.       Plug the kettle into the power point and switch it on.

5.       Switch off kettle once jthe water is boiled, if not boiled repeat step 4.

6.       Pour water from kettle into teapot.
 




ALGORITHM ALGORITHM Reviewed by FJ on 6:58 PM Rating: 5

No comments