When you're given a multi-step task to perform, you may want to break it into pieces,
and assign different pieces to different people.
When you're given a function that does several things,
you may want to break it into ‘smaller’ functions that accomplish the same job!
Consider the function $\,h(x) = 5(x-4)^3 - 7\,$.
This function $\,h\,$ does the following:
Of course, you can delegate the responsibilities in different ways:
Or, you can use more ‘helper’ functions.
For example:
The exercises in this lesson give you practice with this process of writing a function as a composition.
On this exercise, you will not key in your answer. However, you can check to see if your answer is correct. |
PROBLEM TYPES:
|