Choose exam board for KS4 Computer Science (GCSE)
Choose exam board for KS4 English
Choose exam board for KS4 French
Choose exam board for KS4 Geography
Choose exam board for KS4 German
Choose exam board for KS4 History
Choose tier for KS4 Maths
Choose exam board for KS4 Music
Choose exam board for KS4 Physical education (GCSE)
Choose exam board for KS4 Religious education (GCSE)
Choose exam board for KS4 Spanish

      User inputs and variables

      Lesson details

      Learning outcome

      I can use variables and user input to create interactivity in an app.

      Key learning points

      1. Variables are used to store data.
      2. User input can be collected from elements.
      3. Stored values can be reused and combined to create dynamic outputs.

      Keywords

      • Variable - a named piece of data stored in a computer’s memory which can be accessed and changed by a computer program

      • Input - data that is sent to a program to be processed

      • Data type - defines the kind of data a computer can store and the actions you can perform on it

      Common misconception

      Variables always store numbers.

      Variables can store different types of data, including text (strings), numbers or Boolean values.

      Teacher tip

      Pupils will have encountered many uses of apps in the world around them. Tailor the activities in the slides to best reflect the experiences pupils in your school will have had when using app-based technology.

      Equipment

      Pupils will need access to a device with phone app design software. Examples in this lesson use App Lab https://oak.link/app-lab which will require pupils to have a login to obtain access to edit.

      Licence

      This content is © Oak National Academy Limited (2026), licensed on Open Government Licence version 3.0
      except where otherwise stated. See Oak's terms & conditions
      (Collection 2).

      Lesson video

      Loading...

      Prior knowledge starter quiz

      6 Questions

      Q1.
      What is the purpose of an event listener in an app?

      to display images
      to store app settings
      Correct answer: to wait for something to happen and then run code
      to update the app’s theme

      Q2.
      Which action is an example of an event in an app?

      changing the device’s wallpaper
      Correct answer: tapping a button
      charging the battery
      turning off Wi-Fi

      Q3.
      What does a function do in an app?

      stores images
      changes the screen’s brightness
      connects to the internet
      Correct answer: runs a set of instructions when called

      Q4.
      Put these actions in the correct order for responding to a key press:

      1 - user presses a key
      2 - event listener detects the action
      3 - function runs code
      4 - app updates display

      Q5.
      Match each example to the correct term:

      Correct Answer:user taps a button,event

      event

      Correct Answer:code waiting for a swipe,event listener

      event listener

      Correct Answer:instructions to show a message,function

      function

      Q6.
      What is the word for the action that causes an event to happen in an app?

      Correct Answer: trigger, triggering

      6 Questions

      Q1.
      What is the term for a named storage location in a computer program that can hold different values?

      Correct Answer: variable, variables

      Q2.
      What is a data type?

      the name of an app
      Correct answer: the kind of information stored in a variable
      the colour of a button
      the speed of the internet

      Q3.
      Match each example to the correct term:

      Correct Answer:'yes' or 'no',Boolean

      Boolean

      Correct Answer:12345,number

      number

      Correct Answer:'username',text

      text

      Q4.
      Which of these is NOT a valid use for a variable?

      storing a username
      storing a password
      storing the number of clicks
      Correct answer: displaying a picture

      Q5.
      What happens when a user enters data into a form and clicks 'submit'?

      The app ignores the data.
      The app closes.
      Correct answer: The input is stored in a variable.
      The app takes a screenshot.

      Q6.
      What is the term for information a user gives to an app?

      Correct Answer: input

      To help you plan your 8 computing lesson on: User inputs and variables, download all teaching resources for free and adapt to suit your pupils' needs...