Year 7 · Summer 1

Scratch II: Subroutines and lists · Lesson 1 of 5

Decomposition and subroutines (My Blocks)

PracticalTopic 11 Algorithms

Year 7 · Scratch II: Subroutines and lists · Lesson 1 of 5

You will learn to

  • Use decomposition to break a maze game into smaller parts.
  • Create a My Block that does one job.
  • Explain why calling a My Block twice is better than copying the same blocks twice.

Year 7 · Scratch II: Subroutines and lists · Lesson 1 of 5

Success criteria

You have got it when you can say:

  • I can list at least four parts of a maze game.
  • I can make a My Block and use it in two places.
  • I can give one reason why subroutines make code easier to fix.

Year 7 · Scratch II: Subroutines and lists · Lesson 1 of 5

Retrieval starter

Questions from before. Write your answers, then show them.

  1. Last unit

    Which loop always runs at least once?

    A REPEAT … UNTILB WHILE … ENDWHILEC FOR i ← 1 TO 0

    A. REPEAT … UNTIL

  2. Last unit

    Which shape is used for OUTPUT total?

    A RectangleB ParallelogramC Diamond

    B. Parallelogram

  3. Earlier this year

    How many patterns can 3 bits make?

    A 8B 3C 6

    A. 8

Year 7 · Scratch II: Subroutines and lists · Lesson 1 of 5

Key words (1 of 3)

Sequence
Steps run in order, one after another.
Selection
Choosing a path with if / else.
Iteration
Repeating steps: a loop.
Algorithm
Precise, ordered, finite steps to solve a problem.

Year 7 · Scratch II: Subroutines and lists · Lesson 1 of 5

Key words (2 of 3)

Decomposition
Breaking a problem into smaller ones.
Abstraction
Ignoring detail that doesn't matter for the problem.
Sequence · selection · iteration
Steps one after another. First this, then this.
Pseudocode
Code-like writing for algorithms, without strict rules.

Year 7 · Scratch II: Subroutines and lists · Lesson 1 of 5

Key words (3 of 3)

Trace table
Records variable values step by step to check logic.
Variable
A named place in memory that holds a value.

The explanation · step 1 of 1

The three building blocks

BlockMeaningEveryday example
SequenceSteps in orderSocks, then shoes
SelectionChoose a path (if… else…)If it rains, umbrella; else sunglasses
IterationRepeat (loops)Stir 20 times; or stir until smooth
★Remember

Count-controlled loops repeat a set number of times. Condition-controlled loops repeat until something is true.

Year 7 · Scratch II: Subroutines and lists · Lesson 1 of 5

Quick quiz · 1 of 3

Breaking a problem into smaller parts is…

  1. A Iteration
  2. B Decomposition
  3. C Abstraction

B. Decomposition

De-compose = take apart.

Year 7 · Scratch II: Subroutines and lists · Lesson 1 of 5

Quick quiz · 2 of 3

An 'if… else…' is…

  1. A Iteration
  2. B Sequence
  3. C Selection

C. Selection

It selects one path.

Year 7 · Scratch II: Subroutines and lists · Lesson 1 of 5

Quick quiz · 3 of 3

In a flowchart, a decision is a…

  1. A Diamond
  2. B Oval
  3. C Rectangle

A. Diamond

Diamonds have yes/no arrows coming out.

Year 7 · Scratch II: Subroutines and lists · Lesson 1 of 5

Exit ticket

Answer on paper before you go. Then check.

  1. The Tube map leaves out real distances. That's…

    A AbstractionB DecompositionC Pattern recognition

    A. Abstraction Abstraction removes detail that doesn't matter for the problem.

  2. How many times does FOR i ← 2 TO 8 repeat?

    A 7B 6C 8

    A. 7 Both ends count: 8 − 2 + 1 = 7 (2, 3, 4, 5, 6, 7, 8).