You want to summarize some aspect of a data set, like the average, or highest value.
Use a variable as an accumulator.
- Initialize the variable.
- Loop over the cells you want to process. Update the value of the accumulator each time through the loop.
- After the loop, the accumulator has the value you want.
Your program processes one cell at a time, in a loop. The accumulator accumulates the loop’s processing.
total is an accumulator in this code: