Computational Thinking 1 Decomposition things we need and

  • Slides: 11
Download presentation
Computational Thinking

Computational Thinking

1. Decomposition: things we need and tasks to perform to make a jam sandwich.

1. Decomposition: things we need and tasks to perform to make a jam sandwich. Think about everything you need in order to make a jam sandwich. This could include things such as ingredients, equipment and actions. Write as many things down as you can in the space below. All the things we need and tasks to perform to make a jam sandwich. e. g. Unsliced loaf of bread e. g. Plate e. g. Gather ingredients

2. Pattern Recognition: Ingredients, equipment and actions Using the list you created in the

2. Pattern Recognition: Ingredients, equipment and actions Using the list you created in the previous task, place them into the following categories: ingredients, equipment and actions. Ingredients e. g. Unsliced loaf of bread Equipment e. g. Plate Actions e. g. Gather ingredients

3. Abstraction: Make a plan! Rob-Bot has identified the following tasks as being the

3. Abstraction: Make a plan! Rob-Bot has identified the following tasks as being the most important for making a jam sandwich; Re-arrange them into the correct order of events in the table below: Order 1 2 3 4 Task

4 b. Flowchart Algorithm: Make a jam sandwich Flow arrows can be found within

4 b. Flowchart Algorithm: Make a jam sandwich Flow arrows can be found within the Shapes drop down menu. • • • It’s time to create our flowchart! To the right, you will see all the tasks and decisions you need to create either a strawberry or apricot jam sandwich. Using the tasks and decisions provided, create a flowchart algorithm to create a jam sandwich. Make sure you use flow arrows to connect the symbols together. Make sure you add the TRUE and FALSE labels above to each decision correctly!

4 d. Pseudocode algorithm: Make a jam sandwich • Now lets practice writing pseudocode

4 d. Pseudocode algorithm: Make a jam sandwich • Now lets practice writing pseudocode … it’s like writing a recipe! Line 1 2 3 • Using your flowchart algorithm tasks and decisions for guidance, create a pseudocode algorithm to create either a strawberry or apricot jam sandwich. 4 • Write your instructions clearly one row at a time in the table provided. 10 Challenge: Accurately include all of the following words within your pseudocode. START IF INPUT ELSE OUTPUT END 5 6 7 8 9 11 12 13 14 15 16 17 18 19 20 Instructions

5 a. Test your Algorithm! • In pairs, take it in turns to play

5 a. Test your Algorithm! • In pairs, take it in turns to play the roles of the programmer and Rob-bot. • If you are the programmer, your job is to read out the instructions. Choose between your pseudo code or your flowchart. • Rob-Bot must follow every instruction exactly! Questions: 1. Who has a good working example? 2. Who has a bad example? ! 3. Why doesn’t it work? What improvements would you recommend?

The final stage of computational thinking is known as debugging. This means getting rid

The final stage of computational thinking is known as debugging. This means getting rid of errors. It is done by testing your algorithm and making sure it is logical. 5 b. Debugging TASK In pairs, read back through your code and try to identify any errors you may have made. Highlight any errors you encounter in the table below; Common coding errors • Does it make sense? • Flowcharts symbols used correctly? • Any spelling mistakes (Syntax errors)? • Do the decisions make sense (Logic errors)? Test Problems encountered Improvements made 1 2 3 4 5 6 Oops! In programming, everyone makes mistakes, they are part of the learning process! The important thing is to identify the mistake and work out how to overcome it. As a result, the more mistakes you make, the more you learn!

Improve your Code! • After identifying any errors, make improvements to your code. •

Improve your Code! • After identifying any errors, make improvements to your code. • Add print screens of your improved code for making a jam sandwich, for both flowchart and pseudocode algorithms, here.

Review: Computational Thinking 1. Match the Keywords to the correct definition. Add a number

Review: Computational Thinking 1. Match the Keywords to the correct definition. Add a number in the box next to the keyword. Decomposition Pattern Recognition Abstraction Algorithm Debugging Decision 1. Identifying similarities encountered within similar problems. 2. Why is it important to test your code? 2. Step by step instructions on how to complete a task. 3. Breaking down the problem into smaller, more manageable chunks. 4. Focusing on the important information, filtering out unnecessary information. 5. Finding and fixing issues in code. 6. Has one input, and two outputs: yes or no / true or false. 3. Which form of algorithm writing do you prefer (Pseudo code or Flowchart) and why?