0% found this document useful (0 votes)
19 views

L2 Lesson plan - Programming - KS4

Uploaded by

Dowuona Joel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

L2 Lesson plan - Programming - KS4

Uploaded by

Dowuona Joel
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

KS4 - Programming Lesson plan

Lesson 1 - Translators

Lesson 2: Sequence
Introduction
In this lesson, learners will be introduced to a Python IDE of your choice. They
will learn about the function of an IDE and why programmers use these to write
programs. Learners will be given some simple code to predict, run, investigate,
and modify. Whilst they take their first steps in Python programming, they will
also learn about common errors and error types.

Learning objectives
● Describe the tools an IDE provides (editors, error diagnostics, runtime
environment, translators)
● Use subroutines in programs
● Define a sequence as instructions performed in order, with each executed
in turn
● Predict the outcome of a sequence and modify it
● Interpret error messages; define error types and identify them in programs
(logic, syntax)

Key vocabulary
IDE, translator, interpreter, subroutine, sequence, execute, error messages,
syntax error, logic error, syntax

Preparation
Choose your IDE

We recommend that you use Mu as the IDE for Python because it has a friendly
split-screen layout and lots of helpful features for learners. You can download Mu
here: https://codewith.mu/en/download (ncce.io/downloadmu)

Another option is to use Trinket.io, which also offers the split-screen element
where learners can see their code and output in one window.

All programming code will be provided via Trinket and the worksheet.

Subject knowledge:

Page 1 Last updated: 10-05-24


KS4 - Programming Lesson plan
Lesson 1 - Translators

You should have:


● An understanding of IDEs and the functionality that they have to offer
programmers
● The ability to create and use subroutines in Python
● An understanding of sequencing and how this is applied in programs
● An understanding of how commenting should be used in programming
● An understanding of the common error types (syntax, logic)

You will need:


● Slides
● A Python IDE for learners to access — Mu is the recommended IDE
● Teacher resource: Live coding demonstration
● Activities:
○ Your first Python code: A2 worksheet
○ Twinkle, twinkle, little sequence: A3 worksheet and solutions

Optional:
● Vocabulary sheet
● Twinkle, twinkle, Python file (ncce.io/ks4-twinklestart)
● Twinkle complete (ncce.io/ks4-twinklecomplete)

Assessment opportunities
The starter activity allows you to check what learners remembered about
translators from the last lesson. Use this time to recap it with your learners.

The ‘Introducing your IDE’ activity provides an opportunity to see how quickly
learners can debug their programs. It also asks for definitions of syntax and logic
errors, which can be checked against the vocabulary sheet by peers or you.

The ‘Twinkle, twinkle, little sequence’ activity is a PRIMM activity. Model answers
have been provided for this worksheet if you wish to use them for self- or peer-
assessment.

Outline plan
Please note that the slide deck labels the activities in the top right-hand corner
to help you navigate the lesson.

*Timings are rough guides

Page 2 Last updated: 10-05-24


KS4 - Programming Lesson plan
Lesson 1 - Translators

Starter Why do we need translators?


activity
(Slides 2– Ask learners this question to check their understanding of translators
3) from the last lesson. They should think, write, pair, share their
answers. Answers can be shared with the class and clarification is to
3 mins be given where required.

A definition is written on slide 3 for you to check with your learners.

Definition: “Computers can only execute machine code, so


translators are required for executing the programs that
programmers write in high-level languages.”

Activity 1 What is an IDE?


(Slides 5–
14) Present learners with a series of slides that explore the features of
an IDE and demonstrate why they are useful compared to a basic
5 mins text editor.

Introduce learners to the following benefits:


● Colour coding text
● Highlighting syntax
● Automatic indentation
● Autocomplete code
● Error checking/debugging
● Testing in runtime

On slide 13 there is a quick question to see if learners can spot the


features of an IDE used in the example. Ask learners for responses,
before revealing the features on slide 14 to check if they have found
them all.

Activity 2 Introducing your IDE


(Slides 15–
16) It is recommended that you use Mu as your IDE for teaching Python.
This IDE will be used for all live coding video examples provided for
15 mins you.

Use live coding to introduce the IDE and some simple code for
learners to try. Whilst demonstrating the IDE, be sure to talk about
the features described in the previous activity and point these out to
learners.

Write some simple code for your learners.

def welcome():
print(“Hello world”)

welcome()

You’ll be using subroutines right from the start with learners, so that

Page 3 Last updated: 10-05-24


KS4 - Programming Lesson plan
Lesson 1 - Translators

they can become familiar with them. It is not expected that they will
fully understand what they are and how to use them in all scenarios,
as this will be covered later in the unit. The benefit of introducing
subroutines is that learners will be able to separate their code into
units from an early stage, which can help make the finer details of
subroutine creation easier to grasp in the future.

For these materials, we refer to subroutines as the ‘overarching’


name for functions and procedures, to aim to stay true to the
specifications. When learners start to create functions that return
values, they will be referred to as functions. We will also refer to
functions when discussing importing library functions.

When writing the code, demonstrate a syntax error and a logic error,
defining the terms as you do so.

A syntax error: Where the code written doesn’t match the syntax
of the language being used. For example, missing out a closing
bracket or a colon.

A logic error: Can be quite tricky to spot because they are often
not picked up by the IDE. The program will run, but it won’t behave
in the way that you expect it to.

You can cause a logic error by not calling the subroutine and
demonstrating that nothing happens when the code is run, but no
error messages appear.

You can cause a syntax error by going in and deleting a speech mark
or a bracket and showing learners what happens.

Explain that this is all a normal part of programming and that


learners will constantly face these problems. Even advanced
programmers have to look up the syntax every so often because
they can’t remember every detail.

A video has been created for you as an example of how to complete


this live coding activity with your learners. This video is not meant
for the learners, it is a guide for you as a teacher. Take some time to
familiarise yourself with the video and practise your live coding
session before doing it in your classroom.

After live coding with the learners, give them some time to practise
typing in the code used in the demonstration. The ‘Your first Python
code’ worksheet has been prepared for your learners. It reveals
common errors that occur when programming and helps to support
learners through the debugging process. The worksheet also asks
learners to provide definitions for a syntax and logic error before
providing some additional explorer tasks.

Activity 3 Twinkle, twinkle, little sequence


(Slides 17–

Page 4 Last updated: 10-05-24


KS4 - Programming Lesson plan
Lesson 1 - Translators

19) Introduce learners to the idea of a sequence being a set of precise


instructions that are executed from top to bottom, in order. A
20 mins PRIMM activity has been created to allow learners to:

Predict what the code might do when it is run


Run the code to see if their predictions were correct
Investigate the code to find out how it works
Modify the code so that it displays the whole nursery rhyme
Make a similar version for their own favourite song

There might not be enough time for learners to complete the make
step, so this has been set as an optional homework for this lesson.

A copy of the starter (predict) code can be found on Trinket if


needed. Alternatively, you can distribute the file to learners using
your chosen method.

Model answers have been provided for the worksheet to be used for
peer- or self-assessment if needed.

Plenary Multiple choice quiz


(Slides 20–
22) Give the learners three multiple choice questions. You could
facilitate this by using mini whiteboards for writing the answer, or
5 mins handing out cards with A, B, C, or D on them.

You will perform a Peer Instruction activity here. Before revealing


the correct answer, take a look at the answers from the class. Go
through A > D by asking a learner that has chosen A to explain why
they chose that answer. Do not provide any hints to this being the
correct answer at this time. Work your way through all options and
give your learners a chance to change their minds before revealing
the correct answer.

Note: The slides are animated, they will reveal the answer and then
the reason for the correct answer.

Homewor Complete the make step from the Twinkle, twinkle, little sequence’
k activity.

Resources are updated regularly — the latest version is available at: ncce.io/tcc.

Attribution statement
This resource was created by Raspberry Pi Foundation and updated by STEM Learning for the
National Centre for Computing Education.
The contents of this resource are available for use under the Open Government License (OGL v3)
meaning you can copy, adapt, distribute and publish the information. You must acknowledge the
source of the Information in your product or application, by attributing Raspberry Pi Foundation and
STEM Learning as stated here and are asked to provide a link to the OGL v3.
Page 5 Last updated: 10-05-24
KS4 - Programming Lesson plan
Lesson 1 - Translators

The original version can be made available on request via info@teachcomputing.org.

Page 6 Last updated: 10-05-24

You might also like