Comp 101 Fundamental Pattern of Code

Fundamental Pattern of Code

Most of code can be summed into one basic concept. We put something in, something happens, and something else is output.

More scientifically, input is placed into an algorithm, that returns some type of output. We can think of many examples, but one of the easiest to visualize relates to cooking.

https://s-i.huffpost.com/gadgets/slideshows/337377/slide_337377_3422555_free.gif

You throw flour, eggs, sugar, and a few other ingredients into a bowl. These are your inputs. You plop the bowl into the oven, which does something magical. This process (baking) is the algorithm. Then, out comes a yummy cake! This is our output.