Rocket wants to cook fish for dinner with a grown-up. He has four small functions: wash, cut, cook, and plate. "I'll start cooking right now!" he says.
Raven smiles. "Wait. What do you notice about your hands?" Rocket looks down. "Oh. They are muddy from the garden."
Nova glows. "Each function is one stop on a line. Think about which stop comes first." Let's help them call the functions in order.
An assembly line is a chain of small functions. Read the line below.
function wash(): soap hands, rinse, dry function cut(): slice into 4 pieces function cook(): fry until cooked through function plate(): put on a clean plate
Write the four function calls IN ORDER to cook a fish.
Big jobs are often a chain of small functions. Each one does one job well.
The order of the calls still matters, just like in Week 1.
function dig(): dig a small hole function plant(): drop in a seed function cover(): cover it with soil function water(): pour on some water
| Statement | True or false? |
|---|---|
| Each small function should do one job. | ? |
| The order of function calls never matters. | ? |
| You can call the same function many times. | ? |
| A chain of small functions can finish a big job. | ? |