Algorithms:
Before writing any computer program, it is very useful to first outline the steps which will be essential. An algorithm is the series of steps required to solve a problem. In modular approach to programming, the solution of the problem is broken down into separate steps, and then each step is then refined again until the resulting steps are sufficient to be manageable tasks. This is known as the top-down design approach.
As a simple illustration, consider the problem of computing the area of a circle. At First, it is essential to determine what information is required in order to solve the problem, which in this situation is the radius of the circle. Now, given the radius of the circle, the area of the circle would be computed. Last, once the area has been computed, it has to be displayed in some way. Therefore, the basic algorithm is as shown below:
- Obtain the input: the radius
- Compute the result: the area
- Show the output