9_1_2
WHAT: Explain algorithms in terms of their inputs, processes and outputs
SMART START:
Think, pair, share
Can you think of as many input devices as possible?
Extra Mile:
What do you think a process is and how can you make a computer process data faster?
HOW:
(image from Wikimedia Commons)
Activity 1 - READ
Algorithms will have inputs, processes and outputs throughout the instructions. You should be able to spot when these occur and explain what is happening.
DEFINITIONS:
Input - Sending data in to the solution
Process - Calculating / making decisions
Output - Sending information out of the solution (what is produced)
Activity 2 - READ
Take a look at this code. The input, process and output has been labelled using the hashtags.
If I was explaining this algorithm in terms of it's inputs, processes and outputs I would write the following:
The algorithm asks for the user's name (input) and stores this in a variable. The variable is then processed using an if statement. The if statement checks if the name stored in the variable is "me". The check will be processed as True or False. If it is true then the output will be "Hello, me" else it will be "You aren't me".
Activity 3
Try writing an explanation for the algorithm below:
CHECK:
EMBED:
Explain the inputs, processes and outputs used for an Insertion Sort. If you can't remember what an insertion sort is, watch this video. You might want to use some cups or some pieces of paper to help you with your explanation.
CLASSROOM IDEAS:
If the embed task is too challenging then you could ask the students to explain previous solutions that they have created.