Year 8 › Raid: App Forge › Lesson 3 of 5
Year 8 · Summer 2 · Raid: App Forge Events and logic: buttons, variables and conditions
Topic 13 Programming basics
KS3 Computing · A program stores information in variables, works on it with operators, and controls the order with sequence, selection and iteration. Examples are in Python, with Scratch alongside for Year 7.
Programming Cambridge Lower Secondary Computing 0860
You will learn to Explain what event-driven means: code runs when something happens, like a button click. Use a when Button.Click block to set a label's text. Use a global variable to count the clicks. Use an if block to change the message when the count reaches 10.
Success criteria I can make a label change when I press a button. I can show the number of clicks on the screen. I can make the message change at exactly 10 clicks. I can explain how this is different from Python, which runs from top to bottom.
variable A named place in memory that holds a value.
assignment Storing a value in a variable. = in Python, ← in pseudocode.
Casting Changing a value from one data type to another, like int("13").
Concatenation Joining strings together: "7" + "7" = "77".
Selection Choosing a path with if / else.
Iteration Repeating steps: a loop.
Boolean A value that is only True or False.
Infinite loop A loop whose condition never becomes false.
Variables: labelled boxes A variable is a named box in memory that holds a value.
score = 0
score = score + 10
print(score) score = 0: make a box called score, put 0 in it. This is assignment .score = score + 10: read the right side first. 0 + 10 = 10. Put 10 back in the box.print(score) shows 10 .! Watch outIn code, = means 'store', not 'equals'. To ask if two things are equal, use ==.
e.g. ExampleScratch: the orange 'set score to 0' and 'change score by 10' blocks.
Mark this lesson as done Saved on this device.
← Previous lesson App Inventor: screens and components Next lesson → Raid build: an app for a problem at school