During this lesson, learners will be introduced to functions. They have already used built-in functions when programming, but haven’t actually written their own yet. They will learn how to structure a function, and then use a trace table to trace the input, process, and output of various functions. They will then be shown how functions can be used for decomposition, and will take part in a pair programming/live coding activity where they modify a previous program to introduce functions. Finally, homework will be set to test learner understanding of functions.
- Explain the difference between a function and a procedure
- Use trace tables to investigate functions
- Use functions to return values in programs