Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

Design so others can build it

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

45 minutes

A recipe that says "cook until done"

A recipe that says "cook until done" is no help if you have never cooked.

You send your design to a builder you have never met. You are away. They cannot ask you anything.

If a step says "check the booking", the builder must guess how. If a step says "if the hour is before 9, output Closed", the builder knows.

A good design can be built by a stranger.

Key words

WordWhat it meansExample
SequenceSteps done one after another, in order.ask, check, save
SelectionA choice. The path depends on a yes or no answer.if the hour is 21, refuse
IterationDoing steps again and again.for each hour from 9 to 20
LoopCode or a flowchart path that repeats steps.while hour <= 20 (<= means 20 or less)
FlowchartA diagram of steps with arrows.start, check, book
Reusable componentA part you write once and use in many places.price_for()
Sub-systemOne big part of the whole solution.prices, storage, screen
Naming conventionA rule for how names are written, used the same way everywhere.small letters with _ between words, like book_court
Third partyA person outside your team, such as a builder who gets your design.another developer
AudienceThe people who read your design.the manager, the builder

The cells students fill in are left blank in this preview.

The three building blocks of every algorithm

ConstructFlowchart shapeHillside examplePython
SequenceBoxes joined by arrowsInput the hour, then input the court, then saveLines one after another
SelectionA diamond with yes and noIs the hour from 9 to 20?if ... else
IterationAn arrow that goes back upDo this for every hour from 9 to 20for or while

The cells students fill in are left blank in this preview.

Which building block is it?

Have a go

Which building block is it?

5 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

Try it: the same loop in Python

Code: python
names = {10: "Sam", 12: "Aisha"}

hour = 9
while hour <= 20:
    if hour in names:
        print(hour, names[hour])
    else:
        print(hour, "free")
    hour = hour + 1

# The arrow going back up is the while line.
# <= means "is less than or equal to".
# Change 20 to 12 and run it again.

Quick check: building blocks

Have a go

Quick check: building blocks

4 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

The lesson goes on

9 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.