Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introducing Instructions

Similar presentations


Presentation on theme: "Introducing Instructions"— Presentation transcript:

1 Introducing Instructions
Algorithms Introducing Instructions L013

2 The Purpose of this lesson …
? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Develop your understanding of programming by investigating the use and purpose of Algorithms ALL : MOST : Teachers’ Notes: SOME : Screen 2

3 By the end of this lesson …
? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code ALL : MOST : Teachers’ Notes: SOME : Screen 3

4 What are Algorithms ..? Computers are designed to complete tasks Algorithms are the steps needed to complete a task ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Teachers’ Notes: Screen 5

5 What are Algorithms ..? ? Help!  Objectives
 Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Output 10 Input Step One Step Two Step Three Input 6 Input Teachers’ Notes: 25 10 + 10 + 6 41 Click on each component to track the process through the algorithm Screen 6

6 What are Algorithms ..? The Algorithm will set out – step by step – what the computer needs to do The computer will then execute these instructions, follows the instructions, and produces an output This is the Computer Program ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Teachers’ Notes: Screen 7

7 What are Algorithms ..? The program will also tell the computer how to perform each instruction The How part of the program is the Algorithm The Algorithm is the instruction on how to get the job done ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Teachers’ Notes: Screen 8

8 What are Algorithms ..? Algorithms are NOT COMPUTER CODE They are just the steps needed to complete a task ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Teachers’ Notes: Screen 9

9 What are Algorithms ..? A C# programmer can use the same algorithms as a Python programmer They will both code the algorithm differently ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Teachers’ Notes: Screen 10

10 Click to explore more about Algorithms …
? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Simple Algorithms Computer Algorithms Planning Algorithms Thought board Teachers’ Notes: Writing Algorithms To Finish With Watch the Video Screen 11

11 Simple Algorithms ... Suppose you are going to catch the bus What would the Algorithm be for this? ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close What would be the How instructions for catching a bus? Teachers’ Notes: Remember, an Algorithm is the how to do something! Screen 12

12 Simple Algorithms ... Suppose you are going to catch the bus What would the Algorithm be for this? ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Teachers’ Notes: Use the pen tool to plan out your algorithm Screen 13

13 Simple Algorithms ... ? Help!  Objectives
 Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Step 1 Check the bus times Step 2 Make sure I have enough change Step 3 Walk to the bus stop Step 4 Wait for the bus Step 5 Get onto bus Step 6 Pay correct fair Step 7 Sit in seat Teachers’ Notes: Screen 14

14 Simple Algorithms ... Suppose this time the task was to get from your house to the cinema What different algorithms can you come up with to complete this task? ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Teachers’ Notes: What would be the How instructions for catching a bus? Remember, an Algorithm is the how to do something! Screen 15

15 Simple Algorithms ... Suppose this time the task was to get from your house to the cinema ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Teachers’ Notes: Use the pen tool to plan out your algorithm Screen 16

16 Simple Algorithms ... Check the film times Check the bus times Walk to the bus stop Get onto bus Pay correct fair Sit in seat Check the film times Phone for a taxi Get into taxi Pay taxi Each of these algorithms will perform the same task Each algorithm completes the task in a different way They each have a different cost They each have a different completion time ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Check the film times Leave the house Walk to the cinema Teachers’ Notes:  Screen 17

17 Computer Algorithms ... In a program there are different methods to complete a task Each possible method is an Algorithm ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Teachers’ Notes: Screen 18

18 Computer Algorithms ... Each algorithm has advantages and disadvantages in different situations Sorting is one example where there are different types of algorithm available ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Teachers’ Notes: Screen 19

19 You will be learning about some of these algorithms is a future lesson
Computer Algorithms ... There are five different algorithms that are used in sorting: Bin sort Merge sort Bubble sort Shell sort Quick sort ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close You will be learning about some of these algorithms is a future lesson Teachers’ Notes:  Screen 20

20 Planning an Algorithm …
Algorithms form the basic building blocks of any code you write The good news is that there are plenty of websites that include different algorithms already ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Screen 21

21 Planning an Algorithm …
However, it is good practice to plan your algorithms first This helps ensure that the code you write or use will work as you intended ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Screen 22

22 Planning an Algorithm …
There are some basic planning steps you should follow … Start at the end – what does the algorithm need to achieve? Plan the inputs – what data is needed? Name the variables and constants – to store your data Decide on your data types – string, integer, boolean? Plan the first step, then the next and so on until you get your intended result ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Screen 23

23 Planning an Algorithm …
? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Plan a simple algorithm to count to 10 Screen 24

24 Planning an Algorithm …
? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Step 1 – Create a variable called X Step 2 – Set the data type to Real Step 3 – Set the variable starting value to 0 Step 4 – Add 1 to the value of X Step 5 – X = 10 then finish, else Step 6 – Return to Step 4 Would this algorithm work? Screen 25

25 Planning an Algorithm …
Code IT! Using your chosen programing language create your algorithm and test it ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Did your algorithm work? Can you make any comments on its efficiency? Screen 26

26 Planning an Algorithm …
Algorithms need to be as efficient as possible This means they need to take into account any possible use ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Screen 27

27 Planning an Algorithm …
Think about your counting algorithm … What if you needed to count to 15? ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close How can you take this possible use into account in the design of your algorithm? Screen 28

28 Planning an Algorithm …
? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Plan a simple algorithm to count to 10 or 15 Screen 29

29 Planning an Algorithm …
? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close Step 1 – Create a Variable called Y to store the number of counts Step 2 – Set the data type to Integer and the value to 0 Step 3 – Create a variable called X Step 4 – Set the data type to Integer Step 5 – Set the variable starting value to 0 Step 6 – Add 1 to the value of X Step 7 – If X = y then finish, else Step 8 – Return to Step 4  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close What has changed in this algorithm? Screen 30

30 Planning an Algorithm …
Code IT! Using your chosen programing language create your algorithm to count to any value and test it ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Did your algorithm work? Can you make any comments on its efficiency?  Screen 31

31 Writing Algorithms ... Can you work out what these algorithms are doing? ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Step 1 - Start Step 2 - Declare variables Num1, Num2 and Sum Step 3 - Read values Num1 and Num2 Step 4 - Add Num1 and Num2 Step 5 - Assign the result to Sum (Sum = Num1 + Num2) Step 5 - Display Sum Step 6 - Stop Can you work out what each line in the program is doing? Teachers’ Notes: Screen 32

32 Writing Algorithms ... Can you work out what these algorithms are doing? ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Step 1 - Start Step 2 - Declare variables Num1 Step 3 - Read values Num1 Step 4 - If Num1 is > 10 Then Step 5 - Display message “Number is Greater then 10” Else Step 6 - Display message “Number is Less than 10” Step 7 - Stop Can you work out what each line in the program is doing? Teachers’ Notes: Screen 33

33 Writing Algorithms ... Can you work out what these algorithms are doing? ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Step 1 - Start Step 2 - Declare variables UserName and Password Step 3 - Enter UserName and Password Step 4 - Check UserName is list of users Step 5 - If UserName <> list of users then Step 6 - Display message “User Not Found” Else Step 7 - Check Password in list of users for UserName Step 8 - If Password <> list of users then Step 9 - Display message “Password Incorrect” Else Step 10 - Allow login Step 11 - Stop Can you work out what each line in the program is doing? Teachers’ Notes:  Screen 34

34 Judge the efficiency of different algorithms and make recommendations
? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Teachers’ Notes:  Video wont play? Click here for direct link to Youtube Screen 35

35 Programmer | Algorithm | Computer Code | Instructions | Algorithms
To Finish With … An Algorithm is a set of Instructions for completing a task. Algorithms are the building blocks of Computer Code. An algorithm itself is not Computer Code, but any Programmer can use them to create the code for their project. ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Teachers’ Notes: Programmer | Algorithm | Computer Code | Instructions | Algorithms Screen 36

36 To finish With …  Objectives
Instructions Visual Basic Step By Step Algorithm Variable Constant Data Type Program Integer Python String Code Java Real  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close Teachers’ Notes:  Screen 37

37 What have you learnt today?
Thought Board ... What have you learnt today? ? Help!  Pen - Annotate on the screen  Eraser – Remove any annotations  Camera – Save this screen to your computer ? Get help with completing this activity or using this screen  See the learning objectives for this lesson  Check your answers  Reset the activity Close  Objectives Judge the efficiency of different algorithms and make recommendations Prepare and manipulate different algorithms Recognise the role algorithms play in writing code Close Teachers’ Notes: Use the pen tool to add notes to the thought board  Screen 38


Download ppt "Introducing Instructions"

Similar presentations


Ads by Google