L3

Lesson 3: Selection


Programming essentials in Scratch: part I

Computing

Ben Garside

Materials from the Teach Computing Curriculum created by the National Centre for Computing Education

1 / 15
volgende
Slide 1: Slide
newEditorComputingLower Secondary (Key Stage 3)

In deze les zitten 15 slides, met interactieve quiz en tekstslides.

Dit is niet oké

Onderdelen in deze les

Lesson 3: Selection


Programming essentials in Scratch: part I

Computing

Ben Garside

Materials from the Teach Computing Curriculum created by the National Centre for Computing Education

What is a variable?

Learn about true or false expressions

Use expressions in selection

Modify a program to include selection

‹#›

In this lesson you will:

‹#›

What variables would a playing card have?

  • Colour = Black

  • Number = "5"

  • Suit = Spades

Source: Pixabay

‹#›

Think, Pair, Share

True or False?

The colour of this card is black

Source: Pixabay

‹#›

True or False?

The suit of this card is hearts

Source: Pixabay

‹#›

True or False?

The value of this card is greater than 5

Source: Pixabay

‹#›

Conditions and expressions

You evaluated an expression to ‘TRUE’ or ‘FALSE’ and then performed an action depending on the outcome.


If “the card is a heart” is true:

Thumbs up


Else:

Thumbs down

‹#›

A selection statement in programming allows a computer to evaluate an expression to ‘true’ or ‘false’ and then perform an action depending on the outcome.

An If block allows us to check a condition and perform an operation if the condition evaluates to ‘true’.


If the condition evaluates to ‘false’, the operation will not be carried out.

‹#›

An If block with an Else allows us to perform a different operation should the condition evaluate to ‘false’, before the program continues.

‹#›

Conditions and expressions:

‹#›

  • “If you had cereal breakfast this morning, stay standing. Else, sit down.”


  • “If you are wearing black socks, stay standing. Else, sit down.”


  • “If you like pizza, stay standing. Else, sit down.”


  • “If you have a sibling, stay standing. Else, sit down.”


  • “If your birthday is in the first half of the year (Jan–June), stay standing. Else, sit down.”

The IF and the ELSE are both always executed?

1

True

2

False

Option 3

FALSE

‹#›

The IF and the ELSE are both always executed?

MakeCode arcade

We have learnt the basics of game design in scratch, now its time to move on to something more challenging


Sign in with microsoft and Play through the tutorial of MakeCode Arcade - click here


Extension - Start one of the projects in the yellow box