In this lesson
- It starts with a question. The same five lines of tax calculation appear in six places. The rate changes. What is the problem?
- The idea you will find. A parameter is the part allowed to vary. — Everything inside the function stays fixed; the parameter is the slot you fill at each call. Decide carefully what varies — too few parameters and the function is useless elsewhere, too many and nobody can remember how to call it.
- Length. 5 short steps. Progress saves on this phone.
Part of Reusable Code: Functions
Packaging a piece of work under a name so it can be reused and trusted.