LO: Use a Range of Inputs and Selection Within an Algorithm

LO: Use a Range of Inputs and Selection Within an Algorithm

Year 3 Lesson 3:

Lesson summary:This lesson uses the Hopscotch app to explore a range of inputs that can be used within the app. When modeling the use of inputs within programming, a written frame of ‘When…… then……..’ is used to introduce the concept of selection within algorithms.

LO: Use a range of inputs and selection within an algorithm

Introduce the word inputand explain to pupils that inputs are important as they allow the user to interact with technology. Explain that when a user interacts with the input,a message is sent inside the application or item of technology to make an action happen. Use a picture of an oven or toaster to explain this i.e.The dials on the front are inputs as they allow someone to send a message to turn the oven/toaster on and set its temperature. You may also show your phone and demonstrate interacting with it – dialing the school for example.

Lead a discussion with pupils on what inputs they can see on pieces of technology in the classroom around them. Write up their responses on a flipchart and discuss these – pupils may notice the interactive whiteboard, keyboard, mouse etc.

Partner or individual work:Pupils should identify the different inputs on the devices shown in the four pictures on the worksheet (resources below). Model this before pupils start on the activity by explaining that one input for the computer is using the mouse.

Differentiation:

Support: Since the word input may be unfamiliar to pupils, when asking them to identify the inputs a good question to use is ‘How do you use this?’ Pupils are likely to then say ‘You touch the screen…’ etc which enables you to explain that this means the screen is an input as it enables use to interactive with the piece of technology.

Stretch: Pupils could consider or research how inputs have changed as technology has advanced. E.g. touch screens are a more modern form of input.

Connect the iPad to the interactive whiteboard, launch Hopscotch and recap how pupils created a new program and selected an object (character) for their program. Show the pupils that at the top of the programming area there is a drop down menu, which currently displays ‘When play button pressed’. Click this menu to reveal the options available.

Explain to pupils that this list shows us how we can input a message into our program using the different inputs available on the iPad. Link this back to pupils sheets on inputs that they have just completed to see if the inputs match i.e. touch, tilt, microphone for sound.

Introduce the word selection and explain it means ‘to choose something’. Write in large on a board:

‘When………… then……….’

Explain that we can use selection within our algorithms. Model this by selecting a different input from the drop down menu that you have just displayed e.g. ‘When I tap the stage’ and add a piece of code underneath e.gmove by 300. This is shown in the screenshot below:

Talk through with pupils the process of selection in words. i.e. ‘When (I tap the stage) then (move the character 300)’ Play this program and demonstrate what happens when you touch the stage i.e. the sprite thenmoves 300.

Model using a few different inputs controlling different commands and each time explain to the pupils this selection within the ‘When……. then…..’ frame. On each occasion also play the program to demonstrate the programming running.

For example:

When (I tilt the iPad left) then (the character moves 300)

When (I tilt the iPad right) then (the character moves -300) *Note a minus figure is used to make a character move in the opposite direction.

When (I hear a loud noise) then (the character rotates)

Note – several inputs and selection algorithms can be added for each character by selecting: ‘Start new script’as indicated in the screen shot below.

Partner work: Pupils should now work in partners to create their own shorytalgorithms which include inputs and selection within Hopscotch. They should program these and explore the outcomes when ‘Play’ is pressed and they activate the inputs. This should be organised such that pupils take it in turns to write the program whilst their partner predicts the outcome - so they are developing their ability to use logical reasoning to predict the outcome of algorithms.

Questions to aid assessment:

  • What is an input?
  • What is selection?
  • How can we use selection in our algorithms?
  • Can you explain to me how you have used selection in your algorithm?
  • Can you complete the ‘When…..then……’ frame for your algorithm?
  • When I (insert input pupils have used) then what will happen?
  • To make the character (inset the command used by children e.g. to move) what do I need to push?

Plenary – Display a selection of the algorithms that the pupils have written that include selection and a range of inputs. Use the question stems above to encourage pupils to explain the selection in their algorithms by predicting what will happen when the inputs are activated.

Homework Pupils could think about selection algorithms and inputs in the world around them. Some might be mechanical, for example: When I turn a tap then water flows out of it and some may be electrical, for example: When I swipe the iPad unlock screenthen the home screen appears. They should write these down in a ‘When… then…’ frame which they can bring in and share at the beginning of the following lesson.

LO: Identify inputs on a range of devices

Write the inputs for each of these devices in the box beneath the picture. One of theiPad’sinputs has been added for you.

Inputs:
  • The home button
/ Inputs:
Inputs: / Inputs: