1 / 10

Code Blocks and Indentation

Code Blocks and Indentation. Indentation is important. Think of a recipe - Chocolate Cake (Mmmmmm.... Chocolate Cake....). 1. Make the cake 2. Put the frosting on 3. Eat and enjoy. Make the cake?. 1. Make the cake: 1A. make the batter 1B. put into pans

gunnar
Download Presentation

Code Blocks and Indentation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Code BlocksandIndentation

  2. Indentation is important Think of a recipe - Chocolate Cake (Mmmmmm.... Chocolate Cake....) 1. Make the cake 2. Put the frosting on 3. Eat and enjoy

  3. Make the cake? 1. Make the cake: 1A. make the batter 1B. put into pans 1C. bake at 180C for 30-35 minutes 2. Put the frosting on 3. Eat and enjoy

  4. Make the batter? 1. Make the cake: 1A. make the batter: 1Aa. melt chocolate and butter 1Ab. prepare egg mixture 1Ac. sift dry ingredients 1Ad. combine egg mixture, dry ingredients and milk 1Ae. fold egg whites into batter 1B. put into pans 1C. bake at 180C for 30-35 minutes 2. Put the frosting on 3. Eat and enjoy

  5. Melt the chocolate ... ? - Make the cake: - make the batter: - melt chocolate and butter: - In a heavy saucepan over low heat: - put in 6 ounces semi-sweet chocolate - put in 1/2 cup butter - while it hasn’t melted: - wait a little bit - stir - put aside to let cool - prepare egg mixture - sift dry ingredients - combine egg mixture, dry ingredients and milk - fold egg whites into batter - put into pans - bake at 180C for 30-35 minutes - Put the frosting on - Eat and enjoy

  6. Where do I get ... ? - Prepare for cooking: - get 6 ounces of chocolate, 1/2 cup butter - get a saucepan, stove, spoon for stirring - Make the cake: - make the batter: - melt chocolate and butter: - In a heavy saucepan over low heat: - put in 6 ounces semi-sweet chocolate - put in 1/2 cup butter - while it hasn’t melted: - wait a little bit - stir - put aside to let cool - prepare egg mixture - sift dry ingredients - combine egg mixture, dry ingredients and milk - fold egg whites into batter - put into pans - bake at 180C for 30-35 minutes - Put the frosting on - Eat and enjoy

  7. I have/don’t have that! Prepare for cooking: get a kitchen with a good set of cookware start a “Shopping list” for each ingredient in [6 ounces of chocolate, 1/2 cup of butter]: if I don’t have enough of the ingredient: add what’s missing to the shopping list Make the cake: make the batter: melt chocolate and butter: In a heavy saucepan over low heat: put in 6 ounces semi-sweet chocolate put in 1/2 cup butter while it hasn’t melted: wait a little bit stir put aside to let cool prepare egg mixture sift dry ingredients combine egg mixture, dry ingredients and milk fold egg whites into batter put into pans bake at 180C for 30-35 minutes Put the frosting on Eat and enjoy

  8. And the egg mixture? Prepare for cooking: get a kitchen with a good set of cookware start a “Shopping list” for each ingredient in [6 ounces of chocolate, 1/2 cup of butter, 4 eggs, 1/3 cup sugar]: if I don’t have enough of the ingredient: add what’s missing to the shopping list Make the cake: make the batter: melt chocolate and butter: In a heavy saucepan over low heat: put in 6 ounces semi-sweet chocolate put in 1/2 cup butter while it hasn’t melted: wait a little bit stir put aside to let cool prepare egg mixture: get one small bowl for egg whites and another for yolks using two eggs: put the egg whites in the bowl for egg whites put the yolks in the bowl for yolks with the other two eggs: put the yolks in the yolk bowl discard the egg whites mix the yolks until they are thick and a lemon color in the yolk bowl, add 1/3 cup sugar mix the ingredients in the yolk bowl until thick sift dry ingredients combine egg mixture, dry ingredients and milk fold egg whites into batter put into pans bake at 180C for 30-35 minutes Put the frosting on Eat and enjoy

  9. Then the dry ingredients... And folding in the egg whites ... And putting everything into the pans ... And making the frosting ... Oh, and cleaning up afterwards... ...

  10. Making four cakes I’m making birthday cakes for four Swedes, Anders, Lars, Ingela, Jacob. Prepare for cooking (*4) Make the cake (*4) Put the frosting on (*4) for x in [”Anders”,“Lars”,“Ingela”,“Jacob”]: on the cake, write “Happy Birthday, “, x Eat and enjoy

More Related