Standard Methods - Total, Count, Average, Min, Max
Totalling, counting, averaging and finding the minimum or maximum are standard methods used in many programs. You will learn how to set up and update each one inside a loop.
Key terms
- Running total
- Stores the sum of the values processed so far.
- Counter
- Counts how many values have been processed.
- Average
- Calculated as the total divided by the count.
- Minimum
- The smallest value. It is usually initialised to the first value in the list.
- Maximum
- The largest value in a list.
Part of Algorithm Design & Problem Solving.