ABSTRACT

Often computer programs must repeat the same task a number of times. Think of a payroll program that estimates wages and deductions by performing the same calculations for each employee in the company. If you were developing such a program, you could write code to perform salary calculations for each employee. If the company had 100 employees, you would end up with 100 different routines. Although this solution would work, it is cumbersome and awkward. A more reasonable approach is to write a single routine that performs the necessary calculations. The routine is executed for each employee by changing the data set. The result is more compact code that is much easier to develop and test.