Year 7 · Summer 1

Scratch II: Subroutines and lists · Lesson 4 of 5

Design a game with a flowchart before coding

TheoryTopic 11 Algorithms

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

You will learn to

  • Identify the main flowchart shapes: start/stop, input/output, process and decision.
  • Create a flowchart of the main loop of a game.
  • Explain why planning on paper first saves time when coding.

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

Success criteria

You have got it when you can say:

  • I can name and draw the main flowchart shapes.
  • I can draw my game's main loop, with an arrow going back up.
  • I can talk the teacher through my flowchart before I start coding.

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

Retrieval starter

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

  1. Last lesson

    Merge sort is fast on big lists. What's its main cost?

    A It needs extra memory for the merged copiesB It needs the list to be sorted firstC It only works on numbers

    A. It needs extra memory for the merged copies

  2. Last unit

    x = input("Number: ") and the user types 5. What type is x?

    A strB floatC int

    A. str

  3. Earlier this year

    Most of a smartphone's lifetime carbon footprint comes from…

    A Recycling itB Making itC Charging it

    B. Making it

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

Key words (1 of 2)

Algorithm
Precise, ordered, finite steps to solve a problem.
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.

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

Key words (2 of 2)

Pseudocode
Code-like writing for algorithms, without strict rules.
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

Flowcharts

ShapeMeans
Rounded ovalStart / Stop
ParallelogramInput or output
RectangleA process (do something)
DiamondA yes/no decision
Rectangle with double sidesA subroutine
ArrowWhat comes next
e.g.Example

A loop in a flowchart is an arrow going back up to an earlier step.

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

Quick quiz · 1 of 3

Which shape is used for OUTPUT total?

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

C. Parallelogram

Input and output are always parallelograms.

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

Quick quiz · 2 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 4 of 5

Quick quiz · 3 of 3

An 'if… else…' is…

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

A. Selection

It selects one path.

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

Exit ticket

Answer on paper before you go. Then check.

  1. In a flowchart, a decision is a…

    A OvalB DiamondC Rectangle

    B. Diamond Diamonds have yes/no arrows coming out.

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

    A AbstractionB Pattern recognitionC Decomposition

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