Unit 1: Principles of Computer Science

Slides:



Advertisements
Similar presentations
Chocolate Chip Cookies. Ingredients: ½ cup butter (1 stick) 1/3 c. brown sugar (packed) 1/3 c. granulated sugar (white) 1 egg 1/ 2 t. vanilla 1 cup +
Advertisements

COMPILED BY: CHEF SHILPA VANIRE. Cake mixing methods Cake mixing methods By- Mrs. Shilpa Vanire Mrs. Shilpa Vanire(Bakery)
Functional Text I can interpret details in functional text to follow directions, solve problems, follow procedures, and answer questions.
Fun with Parallel Algorithms
New Mexico Computer Science For All Decomposition in Computer Programming Maureen Psaila-Dombrowski.
How to Make a Simple Birthday Cake  Have you ever wanted to make a birthday cake for a loved one? Well, here is how to make a simple birthday cake. All.
How To Make Cupcakes! Instructed by Stephanie Radicevic.
In Thunder Cake, what weather conditions did the characters need in order to bake their cake? A thunder storm!
Sweet Christmas Bread Vánočka. Ingredients Grated lemon peel 2 egg yolks 110 g of powder sugar 1 pack of vanilla sugar 0,25 l of warm milk 500 g of plain.
How To Make Multi coloured Cupcakes By Tian Crisford.
How- To Writing. HOW-TO WRITING CCSS ELA-LITERACY 3.W.2A,B,C,D.
BÁBOVKA Ingredients: 2 cups all purpose flour 1 cup sugar 1 cup milk 2 eggs ½ cup oil 1 tsp baking powder raisins oil or fat for brushing.
Lemon cookies. Lemon cookies ingredients: 260 g fl our 1 egg yolk 135 g butter 2 tablespoons milk 100 g sugar 1 lemon.
Ingredients 1 1/2 cups sugar 2/3 cup shortening or butter* 2 eggs 2 tablespoons milk 1 teaspoon vanilla extract 3 ¼ cups flour 2 1/2 teaspoons baking.
By James Creamer Cupcake Recipe. Ingredients 2 1/4 cups all purpose flour 1 1/3 cups sugar 3 teaspoons baking powder 1/2 teaspoon salt 1/2 cup shortening.
Math Math Math Why do we study math? First of all, it’s all around us! First of all, it’s all around us!
By: Shaelyn Laurie How To Bake A Cake. Step 1: The Recipe Ingredients 2 cups (500 mL) sugar 4 eggs 2-1/2 cups (625 mL) all-purpose flour 1 cup (250 mL)
HOW TO MAKE A SPONGE CAKE? BY: Group 3 Donnette Yearwood Khadija Winchester Janine John.
Transition Words Cake Recipe.
How to read a recipe – the basics!. HOW TO READ A RECIPE Baking and cooking are two very different kitchen skills. Generally speaking, you bake cakes,
The Cupcake By Master Pastry Chef. Ingredients : +3 cups cake flour sifted +2 1/2 teaspoons baking powder +1/2 teaspoon salt +1 3/4 cups granulated sugar.
Apple pie Photo from: Kotikokki.net. Ingredients 200 g butter 1,5 dl sugar 3 dl flour 1 egg 0,75 dl milk 1 tsp baking powder 1 tsp vanilla sugar 3-4 apples.
How to make scones A special recipe made by form 54.
RECIPE. NAME: Three chocolates cake. INGREDIENTS 3 cups 1 1/2 tsp 3/4 tsp 1 1/2 tsp 2 2/3 cups 1 cup + 2 Tb 1 cup + 2 Tb 1 cup + 2 Tb 5 large or 4 Jumbo.
How To Bake A Cake Kayla Golack Period Exer03.
Have you ever had cake and jello at the same time?
1 Computers Can’t Cook! Programming Methodology Girls Engaged in Math and Science, June 2012 Bri Chapman.
Following a Recipe The do’s and don’ts!. If you were taking a road trip to some place you had never been to before, what would you want to take with you?
How to make a vanilla cake with frosting By: Daniela Rodriguez Power-Point
Croquets de Bordeaux Ingredients : 125 g of flour 50 g of sugar 75 g of almonds 1 eggs Vanilla pod 1 packet of baking powder 50 g of butter.
Friends for Chip By: Carla Vela.  This is Chip, Hershey C. Chip.
Algorithms A sequence of instructions 1. Preheat oven to 350 degrees F (175 degrees C). Grease and flour a 9x9 inch pan or line a muffin pan with paper.
How to Bake Brownies Julie Galbraith FVP12. Supplies Needed An Oven A Pan Butter Salt Flour Sugar Cocoa Vanilla Baking Powder Eggs Spoons Measuring Cups.
Instructional Video Read the Recipe Select Ingredients And Equipment Prepare The Recipe BAKING COOKIES IN THE VIRTUAL WORLD HELP About LO.
How to make a BIG sponge cake! By Gina kinsman.. Ingredients! You will need: ½ cup of milk 2 teaspoons & table spoons of unsalted butter 8 large eggs.
THAT WAS A PIECE OF CAKE “Show Me How” By: Kathryn Stone.
Following a Recipe The do’s and don’ts! Original Author Unknown Modified By: CTAE Resource Network.
FROM SCRATCH UTENSILS NEEDED Original recipe makes 1 - 9x13 inch cake 9X13 Dish Pan Large Bowl.
How-To Make Banana Bread Kindergarten made Banana Bread to share with parents on the Conference Days.
How to make chocolate chip cookies By Rose Savage.
Math on the Menu By Lauren.
Apple Cinnamon Muffins. Person 1 In a bowl mix 1 ½ c flour 3/4 c white sugar ½ tsp salt 2 tsp cinnamon 2 tsp baking powder.
FACTORS OF PRODUCTION What is it made of??. LEARNING TARGET I can explain the factors of production I can describe the production process I can identify.
Ice cream cake cupcake By Faith Kyle and Victoria Kroeker.
Lemon Cakes Step by Step Recipe Ingredients Flour Baking Powder Fine Sugar Curd Egg Oil Lemon Juice For Icing Icing Sugar Lemon Juice Hot Water 2/3 cup.
Sour Cream Pound Cake. 2 cups butter, softened 3 cups white sugar 6 eggs 1 teaspoon vanilla extract.
Pierre Kerboriou Chocolate Fairy Cake Less than 30min preparation time.
Birthday Chocolate Cake ♥
How to make Cake Balls By Amanda Swords.
How to Make a Cake Mrs. Janasik.
OTTW Project Afraa Haque
Following a Recipe The do’s and don’ts! Original Author Unknown
Reading a Recipe.
Computer Science Department
Cooking Show Format Here’s this wonderful thing we made – then how we made it – and the wonderful thing again!
Proportional Problems 2 – RECIPES
Reading a Recipe and Measuring Ingredients
A recipe for chocolate cake.
Reading a Recipe and Measuring Ingredients
Pink Cake.
1.02 M Timetables 1.02M Timetables.

Original Bulgarian Breakfast
Experimental Plan? Who needs a plan anyway??.
COMPUTATIONAL THINKING COMPUTATIONAL THINKING IN PROGRAMMING
Birthday cake BABY MOMO.
Top-Down Design & JSP Skill Area Part D
Fruity muffins Ingredients 250g self raising flour
Recipe Chocolate cake.
1.02 C Work Plans The secret for success! 1.02C Work Plans.
Presentation transcript:

Unit 1: Principles of Computer Science Decomposition in Computer Programming Mr Chandler This presentation discusses decomposition in computer programming, what it is, how we do it and why we would want to do it

Decomposition – Yuck! There is nothing rotten about computer programming We mean the other definition – breaking into parts OK so when I think about decomposition I think about, well, dead bodies. So what do dead bodies and computer programming have in common - not much thank goodness. there is absolutly nothing rotten about computer programming. When we talk about decomposition in computer programming we mean the other definition of decomposition – breaking into something into its component parts

How to Create a Computer Program Computer program = list of instructions To Write a Computer Program Identify the problem Break it into separate parts (Decomposition) Sometimes the problem must be simplified first (Abstraction) Create the code for each part Combine the pieces of code to create the program So remember that a computer program is just a list of steps or instructions that you want the computer to perform to solve a problem. So when you write a computer program you need to know what those steps are No problem, it’s a piece of cake. Here what you need to do Identify the problem you want the computer to solve Break it into components or steps that can be solved (that is DECOMPOSITION which we will be discussing in this video). Sometimes the problem has to be simplified first before you can break it down into steps (that is called abstraction which we will talk about in another video Then create code for each component or part Then you combine the pieces of code to create the computer program!

Decomposition Steps Divide and Conquer Step 1: Identify the parts Roughly the same level of detail Can be written up separately Combine to solve the original problem Step 2: Write the steps for each part Step 3: Combine the steps for each part to solve the problem So you can think of Decomposition as dividing and conquering the problem. When you decompose a problem, the first thing you do is identify the parts of the problem. Each of these parts should have about the same level of detail and you should be able to write them up or do them separately. When you combine the pieces, they should solve the original problem. After you break the problem down into parts, the next step in decomposition is writing out the steps in code for each part. Then you put all the steps together in the correct order and you get the code that solves the problem So what we need to do is look at an example… but we don’t know enough yet to look at a programming example so lets decompose a different type of problem

Example: I Want Cake! Step 1: Identify the Components or Parts Gather the Equipment Gather the Ingredients Measure the Ingredients Mix the Ingredients Bake the Cake Lets look at an example. I want cake. I absolutely, desperately want cake but I need to make a cake if I want it. Lets decompose the problem. The first step is to break the problem into its components or parts. So the the components of my problem of wanting cake are.. … Roughly the same level of detail Can be written up separately Combine to solve the original problem It is important to know that someone else might decompose the problem differently and that is OK too.

Example: I Want Cake! (continued) Step 2: Write the Steps A. Gather the Equipment Get the mixing bowls Get small bowls to measure ingredients into Get cake pans Get mixer Get measuring spoons Get measuring cups So now we proceed to step two of the decomposition process – writing steps for each part. Lets look at the fist part – gathering the equipment. Here are the steps ….

Example: I Want Cake! (continued) Step 2: Write the Steps (continued) B. Gather the Ingredients Get the flour Get the sugar Get the oil Get the vanilla Get the eggs Get the baking powder Get the milk Get the pam Lets look at the next part of the decomposition of my cake problem – gathering the ingredients

Example: I Want Cake! (continued) Step 2: Write the Steps (continued) C. Measure the Ingredients Measure 1 ½ cups flour Put flour in small bowl Measure1 cup sugar Put in another bowl …. You get the idea (continue for parts D and E) And now part three – measuring the ingredients…. Well you get the idea. You would do the same for parts D and E

Example: I Want Cake! (continued) Step 3: Put the pieces back together Gather the Equipment Gather the Ingredients Measure the Ingredients Mix the Ingredients Bake the Cake Then carry out all the small steps………. ………… And when you are done you have Cake! The next step in the decomposition of my wanting cake problem is putting the pieces and their steps back together. Then we would carry out the steps – which would be equivalent to running the program and voila when we are done we would Have Cake

Advantages of Decomposition Easier to think about smaller pieces of the problem than the whole problem at once. Different people can work on each part (speeds up programming). Someone might gather the ingredients while someone else measure them. Parallel Processing might be possible (speeds up execution). You could preheat the oven while you are preparing the batter. So that is what decomposition looks like… some advantages of decomposition are

Disadvantages of Decomposition Computers are Stupid They do exactly what you tell them to do even if it is WRONG. They do the steps in exactly the order you tell them to do even if that’s WRONG too! Sometimes problems cannot be decomposed without simplifying them first Too difficult Not well understood Sometimes when you put the pieces back together it does not work!

Summary Decomposition This is good because But Remember- Break the problem into its components Write the steps (code) for each component Put the pieces together to make the program and solve the problem! This is good because It is easier to think about Programming and execution can be faster But Remember- Computers are stupid - they do: Exactly what you tell them to do Exactly how you tell them to do it Sometimes putting the pieces together doesn’t work