Unit Overview - Programming - KS4
Unit Overview - Programming - KS4
Unit overview
KS4 – Programming
Enjoyed teaching these lessons? Found a mistake? Share feedback at the-cc.io/feedback.
Unit introduction
This extensive programming unit takes learners from being complete novices to having the confidence to tackle any GCSE-level
programming challenge. Essential programming theory is also interleaved into the practical elements of programming to provide
tangible links between required knowledge and skills.
The latest pedagogical research has been used to ensure that learners are appropriately scaffolded and challenged as they move
through the lessons. Learners that have already programmed with a text-based language might advance through the earlier lessons at a
faster rate than planned. Explorer tasks have been provided to help stretch learners that need a further challenge.
Overview of lessons
Lesson 1: Translators In this lesson, learners will be introduced to the notion that humans ● Compare how humans and
interpret instructions differently to computers. This is to help them computers interpret
understand that computers need clear and precise instructions in order instructions
● Explain the differences
to perform the expected task. Learners will also be taken on a journey
between high- and low-level
from machine code to high-level languages in order to discover how a programming languages
computer interprets instructions. ● Describe why translators are
necessary
● List the differences, benefits,
and drawbacks of using a
compiler, or an interpreter
Lesson 2: Sequence In this lesson, learners will be introduced to a Python IDE of your choice. ● Describe the tools an IDE
They will learn about the function of an IDE and why programmers use provides (editors, error
these to write programs. Learners will be given some simple code to diagnostics, runtime
predict, run, investigate, and modify. Whilst they take their first steps in environment, translators)
Python programming, they will also learn about common errors and ● Use subroutines in programs
error types. ● 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 and
define error types and identify
them in programs (logic,
syntax)
Lesson 3: Variables Learners will find out about variables during this lesson. They will learn ● Use meaningful identifiers
about the purpose of variables, but also the technical aspects of ● Determine the need for
creating variables to a uniform standard. Variable declaration is not variables
used in Python, so a wider look at this through other programming ● Distinguish between
languages will help learners gain an insight into its meaning. declaration, initialisation, and
assignment of variables
Lesson 4: Input During this lesson learners will start to add interactivity to their ● Obtain input from the
programs by introducing the input() function. Learners will be given a keyboard in a program
demonstration of how input() is used in Python and then asked to ● Differentiate between the data
add this feature in their silly stories that were created last lesson. types: integer, real, Boolean,
Learners will then be introduced to the five main data types that they character, string
need to understand. This is done first through theory teaching and then ● Cast variables by calling a
a practical activity where learners predict, run and investigate a function that will return a new
program that includes the five data types. Whilst learning about input, value of the desired data type
learners will be introduced to functions and data validation techniques. ● Define runtime errors in
These will be covered in more detail later on in the course. programs
● Define validation checks
Lesson 5: Flowcharts The focus of this lesson is for learners to interpret and create ● Identify flowchart symbols
flowcharts. They will use their knowledge of writing simple sequences and describe how to use them
and subroutines to follow a flowchart, and write the code that it (start, end, input, output,
represents. They will be given time to write their own simple flowcharts subroutine)
in order to practise using the symbols that they have learnt during the ● Translate a flowchart into a
lesson. This is an introduction to flowchart design and will be built upon program sequence
throughout the unit. ● Design a flowchart for a
program
Lesson 6: In computer science, random numbers are something that you are ● Be able to locate information
Randomisation likely to use regularly. They are also used in areas such as using the language
cryptography, while pseudo-random numbers are used in video games, documentation
modelling, and simulations. In this lesson, learners will be introduced to ● Import modules into your
the concept of random numbers using Python documentation. Learners code
will determine what the random module is capable of, and how random ● Demonstrate how to generate
numbers can be generated in Python. random numbers
Lesson 7: Arithmetic This lesson has been designed to ensure that learners understand the ● Evaluate arithmetic
expressions rules of operator precedence when evaluating arithmetic expressions. expressions using rules of
They will be reminded of BIDMAS, before investigating code that uses operator precedence
various arithmetic expressions. This lesson will prepare them for the (BIDMAS)
next lesson, where they will begin to use conditions in programming. ● Write and use expressions that
use arithmetic operators (add,
subtract, multiply, real division,
integer division, MOD, to the
power)
● Assign expressions to
variables
Lesson 8: Selection This lesson moves learners on to the next big programming construct: ● Define a condition as an
selection. They will be introduced to it initially through a flowchart that expression that can be
demonstrates how a condition can be used to control the flow of evaluated to either True or
execution in a program. They will then learn about definitions for logical False
expressions and conditions. A short activity has been included to allow ● Identify flowchart symbols
learners to grasp how logical expressions evaluate. Next, they will and describe how to use them
complete a PRIMM activity where they investigate and modify a (decision)
chatterbot. Finally, peer instruction will be used to assess their learning. ● Identify that selection uses
conditions to control the flow
of execution
● Walkthrough code that
Lesson 9: Selection This lesson is an extension of Lesson 8, in which learners completed a ● Use selection statements in a
challenge PRIMM activity that introduced them to selection. This is the ‘make’ part program
of PRIMM, where learners will complete a pair programming activity to ● Identify when selection
create a joke machine. This will allow learners to apply their new statements should be used in
knowledge to a new, but similar scenario. programs
● Write and use expressions that
use comparison operators
(equal to, not equal to, less
than, greater than, less than or
equal to, greater than or equal
to)
Lesson 10: Logical This lesson will deepen learners’ understanding of logical expressions ● Describe how Boolean/logical
expressions by introducing the operators AND and OR. It will begin with a Parson's operators can be used in
Problem to check the learners’ understanding of selection. It will then expressions
move on to an unplugged activity that introduces AND and OR. ● Walk through code that use
Learner's will walk through code, and investigate it before writing their conditions with
own logical expressions. Boolean/logical operators
(AND, OR)
● Write and use expressions that
use Boolean/logical operators
(AND, OR)
Lesson 11: Nested This lesson introduces learners to the concept of nesting if statements. ● Define nested selection
selection Learners will walk through some basic nested statements to check their ● Walk through code that uses
understanding. They will then follow the PRIMM approach and nested selection
investigate a ‘guess the animal’ game. Learners will modify the game to ● Modify a program that uses
Lesson 12: While loops This lesson allows learners to find out about using iteration in their ● Define iteration as a group of
programs. It will define iteration, give a code walkthrough of a while instructions that are
loop, and then use a ‘guess the number’ game as a practical example repeatedly executed
for using iteration. Live coding will be used to turn an if statement into ● Modify a program to
a while loop, and learners will be given a series of challenges to incorporate a while loop
extend the ‘guess the number’ game using programming skills that they
have gained during this course.
Lesson 13: Trace tables This lesson has been designed to deepen learners’ understanding of a ● Use a trace table to
while loop whilst introducing trace tables. Learners will be given an walkthrough code that uses a
example of how to use a trace table, then they will be given various while loop
loops to trace. Trace tables are a valuable part of programming ● Use a trace table to detect
because they allow learners to walk through code and detect errors. and correct errors in
programs
Lesson 14: For loops This lesson is designed to introduce learners to the concept of a for ● Define a for loop
loop. They will learn about the definition, and be shown how the range ● Walk through code that uses a
function can be used with a for loop. This lesson only focuses on the for loop
range function; the wider use of for loops will be covered later on in ● Modify a program that uses a
the unit. This will enable them to be able to compare a while loop and for loop
a for loop at an earlier stage in the unit. After a walkthrough of a for ● Compare a while loop and a
loop, learners will be given a times table generator to explore and for loop
modify. Finally, learners will compare a while loop to a for loop and
develop definitions for each.
Lesson 15: Data Learners will spend this lesson finding out how to effectively add data ● Determine the need for
validation validation techniques to their programs. They will learn why they are validation checks
important, and how to incorporate them. Before this lesson, learners ● Use iteration to perform
have only used a try and except technique that works once, then breaks validation checks
the second time. This lesson will show them how to incorporate try and
except inside a while loop. It will also show learners how to check the
range of a value and if a user input has been left empty.
Lesson 16 and 17: The next two lessons have been created to introduce learners to ● Describe the purpose of
Pseudocode pseudocode, whilst giving them the opportunity to design a program. It pseudocode
has been designed over two lessons to give learners the time to get ● Translate pseudocode into a
stuck into solving a problem. They will be designing and creating a program
FizzBuzz quiz as part of the main task. ● Design and build a program
using pseudocode
For the purpose of this unit, we shall use The Computing pseudocode.
You may wish to replace this with pseudocode from your chosen
examination board.
Lesson 18: Subroutines Learners need to determine why subroutines are used in programs. Use ● Describe a subroutine
live coding to improve a calculator-style program by introducing ● Describe the purpose of
subroutines. Learners will discover the advantages of using subroutines, parameters in subroutines
and how they are used for decomposition. They will also modify a ● Use procedures that accept
subroutine that uses parameters. arguments through
parameters
● Describe how subroutines are
used for decomposition
● List the advantages of
subroutines
Lesson 19: Functions During this lesson, learners will be introduced to functions. They have ● Explain the difference
already used built-in functions when programming, but haven’t actually between a function and a
written their own yet. They will learn how to structure a function, and procedure
then use a trace table to trace the input, process, and output of various ● Use trace tables to investigate
functions. They will then be shown how functions can be used for functions
decomposition, and will take part in a pair programming/live coding ● Use functions to return values
activity where they modify a previous program to introduce functions. in programs
Finally, homework will be set to test the learners’ understanding of
functions.
Lesson 20: Scope Learners will be introduced to the concept of scope in this lesson. They ● Describe scope of variables
will be briefed on the definitions, before being given example programs ● Describe how parameters can
that show how local and global scope work in Python. There is an reduce the need for global
activity where learners will convert programs that use global variables variables
into programs that pass values through parameters instead. This ● Identify when to use global
demonstrates that passing values through parameters can reduce the variables
need for global variables. Learners will then be introduced to constants ● Describe a constant
and how these work in Python, before they complete a lesson quiz.
Lesson 21: XOR Learners were introduced to logic operators in Lesson 10. At that point, ● Use a truth table
they could only use AND and OR. Learners also need an understanding ● Describe the function of an
of how the XOR operator works. Python doesn’t have an XOR operator, XOR operator
so they will create their own function for one in this lesson. Learners will ● Design and create a function
be reminded of AND and OR, and then introduced to truth tables. They for an XOR operator
will learn about XOR, and complete a truth table for the operator. Next,
they will dive into designing and creating a function for an XOR
operator, using worked examples for support.
Lesson 22: Structured This lesson introduces learners to the structured approach to ● Describe the structured
programming programming. They will learn to describe structured programming approach to programming
through a series of exercises. Firstly, learners will be introduced to the ● Explain the advantages of the
concept that all blocks of code should have one entry point and one structured approach
exit point. They will be shown how to avoid breaks and multiple returns ● Use the structured approach
in their programs through some exercises. They will also see how to in programming
create a structure chart for a dog walking program. They will complete
this in pairs, before attempting to complete the program independently
using the structure chart as a guide. Completing these activities will help
to build decomposition skills in your learners, whilst they discover the
advantages of the structured programming approach.
Lesson 23 and 24: This lesson begins with an exploration of the different ways to test ● Describe iterative testing
Create a program programs, followed by a few example tests to complete. Learners will ● Describe the types of testing
be introduced to their project, which will be used to check their (erroneous, boundary,
understanding of all the concepts covered up to this point. As they normal)
create their program, they will use their testing skills to perform tests on ● Design and create a program
the program. The program is quite complex, so some scaffolding has
been provided to help learners. It is expected that learners will reach
different levels of completion for this project. A rubric has been
provided to help you assess the project.
Although two lessons have been allocated for this project, you might
decide that more time is required. You should use your professional
judgement to increase the time allowance if needed.
Lesson 25: GUIs This lesson provides learners with a tour of the world of GUIs (graphical ● Define the term GUI
user interfaces). It uses the third-party module guizero to create GUI ● Import third-party libraries
apps. This will give learners the experience of using a third-party ● Use guizero to create an
module whilst they explore the differences between event-driven event-driven program that
programming and procedural programming. Procedural programs uses a GUI
execute code in a sequence, event-driven programs react to events
triggered by the user or sensors. Learners will discover how GUIs are
different to the sequential programs that they have created so far,
before they make their own app that adds two numbers together. They
will then be stretched further with the creation of a joke machine. These
programs will be familiar to the learners, but will now be represented in
a GUI environment.
Lesson 26: String This lesson introduces learners to string-handling techniques. They will ● Describe the function of string
handling I be given two new techniques to use (length and access a character), operators
before being given a programming challenge where they will use these ● Use string-handling
techniques in a ‘guess the word’ game. Then, they will be shown how a techniques
string can be iterated over, using a for loop. A walk through is used to ● Use for loops with string
help learners build a mental model of how this works. They will be operations
asked to use this technique to add extra functionality to their ‘guess the
word’ game. Finally, learners will explore the Python documentation for
different string methods.
Lesson 27: String In this lesson, learners are introduced to three new techniques that can ● Use a substring in a program
handling II be used with string handling. The first two focus on substrings. First, ● Use the in operator to check
learners are shown how to slice a string and hold it in a variable. Next, for a substring
learners are shown how to check for a substring within a string. Finally, ● Use chr() and ord() to
learners are introduced to ASCII conversion techniques, and are perform ASCII conversions
presented with a challenge to create a message decoder.
Lesson 28: String This lesson allows learners to create a program that uses a variety of ● Create a program that uses
handling III string-handling techniques. It also makes use of the random module. string-handling techniques
Learners have not seen this for a while, so a starter activity has been
created to help refamiliarise them with randomisation.
The main activity for this lesson is to produce a program that will create
a secure password based on three random words. It uses
randomisation and string-handling techniques to produce the secure
password.
Lesson 29: Arrays and This lesson introduces learners to the data structures: arrays and lists. It ● Define a data structure
lists defines them, and explains the differences between the two. It then ● Define a list and an array
moves on to focus on lists in Python. Learners use lists to create a ● Describe the differences
‘Simon says…’ game that randomly selects instructions from a list of between lists and arrays
items. They then move on to learning about append(), and remove(), ● Use a list in a program
and perform a shopping list activity where they practise using the ● Append to a list
methods
Lesson 30: List This lesson introduces learners to the many other list methods that can ● Traverse a list of elements
methods be used in programming. These were briefly introduced at the end of ● Use list methods
the last lesson. It also demonstrates that a list can be traversed using a ● Create a function that returns
for loop in much the same way as you can iterate over a string. a list
Learners then complete an activity where they populate a deck of ● Import custom-built functions
cards and perform some list operations and methods on the deck.
Finally, learners are shown that lists can be returned from a function;
Lesson 31: Sense HAT I This lesson uses the Raspberry Pi Sense HAT to explore the use of lists. ● Use lists to display output on a
Learners can either use the physical device or an emulator accessed physical computing device
via Trinket to interact with a Sense HAT. This lesson introduces the
Sense HAT with some basic techniques in preparation for the next
lesson, where they will be given a programming challenge to complete.
For this lesson, it might be helpful if learners were aware of how RGB
colours work. This is covered in the KS4 – ‘Data representations’ unit.
Lesson 32: Sense HAT II This lesson gives learners the opportunity to complete three small ● Use randomisation to append
projects with the Sense HAT. Through the first two activities they will items to a list
learn how to add random items to a list by using choice() and
append(). They will then finish the lesson by creating a Magic 8-Ball
that works with the Sense HAT. Finally, learners will have some time to
showcase their favourite projects to the class.
Lesson 33: 2D arrays Learners are introduced to two-dimensional arrays and lists during this ● Define a 2D array and a list
and lists lesson. They will be defined, and then learners will be shown how to ● Use a 2D list in a program
access lists and single items in those lists, before they complete an
activity to practise these skills. Next, learners will find out how to change
and append a 2D list through demonstration, before they create their
own password manager programs.
Lesson 34 and 35: 2D This lesson begins with reminding learners about iterative and final ● Use a 2D list as part of a
lists challenge testing. Learners are then introduced to their challenge, which is to programming challenge
create a noughts and crosses game. As they create their program, they
will use their testing skills to perform tests on the program. The
program is quite complex, so some scaffolding has been provided. It is
expected that learners will reach different levels of completion for this
project. A rubric has been provided to help you assess the project.
Although two lessons have been allocated for this project, you may
decide that more time is required. You should use your professional
judgement to increase the time allowance if needed.
Lesson 36: Records This lesson introduces learners to two new data structures. A record ● Describe the record data
and dictionaries and a dictionary. The focus of this lesson is on records and how these structure
can be created and used in Python to form a database. Learners will be ● Use a dictionary to represent
shown how to use a dictionary as a record before creating a ‘database’ a record in a program
using dictionaries within a list. ● Use a dictionary with a list to
represent records in a
Note: This lesson uses a dictionary to represent a record because the record database
data structure isn’t available in Python. The standard use of dictionaries will be
covered in the next lesson.
Lesson 37: Dictionary This lesson gives learners the opportunity to use a dictionary data ● Describe the dictionary data
challenge structure in a new context. Learners will create a Caesar cipher structure
encryption program using a dictionary as the cipher wheel. This mini ● Use a dictionary to produce
project will allow learners to develop their programming skills through key-value pairs
an appropriate challenge and it can also be assessed using a rubric.
Lesson 38: Reading text Learners will be introduced to text files in this lesson. The focus will be ● Determine the purpose of
files on reading text files, and how the data from a text file can be used external data files
within a program. Learners will be stepped through the key methods ● Read data from an external
that are used for reading text files in Python, before they complete two text file
text file challenges.
Lesson 39: Writing to This lesson continues the exploration of text files with the addition of ● Write to text files
text files writing and appending to files. Live coding will be used to introduce the ● Append to text files
two new concepts and mini challenges are used to allow learners to test
their understanding of them.
Lesson 40: Work with Learners are already familiar with text files and how to read the data ● Describe a CSV file
CSV files from them. A CSV file is still a text file and you can use the same ● Read from a CSV file
methods and modes that you can with a standard file. However, you ● Use the split() method
might use a CSV file for different purposes and operations. This lesson ● Select data from a collection
introduces learners to CSV files and will show them how to read data of values
into a list and a 2D list, before setting them challenges where they will
work with the data.
Lesson 41: Write to CSV Building on from the last three lessons, learners will discover how to ● Write data from a 1D list to a
files write to CSV files. They work with 1D and 2D lists, before converting CSV file
them to string and writing them to CSV files. There are lots of list ● Write data from a 2D list to a
challenges this lesson, which should help to enhance their skills in CSV file
preparation for the final project.
This lesson includes some complex challenges for your learners. You
may wish to give them two lessons to complete this work or set one
activity for homework.
Lesson 42: Being a This lesson has been designed to round up the learning from this unit. It ● Determine the good habits of
programmer is the last lesson of new content before they take on their final projects. a programmer
Learners will discuss the good habits of a programmer before being ● Explore alternative
reminded of why some of the key aspects are good habits. Learners will approaches to programming
also hear from industry programmers about their own good practice. solutions
● Append to a CSV file
Learners are then shown alternative approaches to programming
solutions. This unit has consistently used specific approaches to help
them learn different skills. They are now experienced enough to be able
to see the other approaches and try them for themselves in their own
programs.
Lesson 43: Battle boats This is the first in a series of eight lessons where learners complete their ● Write success criteria for a
final programming challenge of the unit. This is their formal assessment challenging project
for the unit. The project is very challenging, but it does cover everything
that they have learnt over this unit. The key is, can they put it all
together? This lesson focuses on familiarising learners with the game
and the scenario. Learners will write their success criteria for the game
to be used next lesson when they design their pseudocode or
flowcharts.
Lesson 44: Battle boats This is lesson two of an eight lesson project. Learners will now use their ● Design the program for a
design success criteria to help them with their design work. Examples are given challenging project using
to support learners before they spend the majority of the lesson flowchart or pseudocode
thinking about their designs.
This is a large, challenging project. You may wish to spread this over
two lessons or set completion for homework if your learners need more
time.
Lesson 45 to 48: Battle These four lessons are part of an eight lesson programming challenge. ● Create the solution for the
boats code These lessons are designed to give learners time to code their solutions. battle boats program
They will also have the opportunity to complete a code log to track
their progress as they go.
Lesson 49: Battle boats This is the penultimate lesson of an eight lesson project. Learners will ● Perform final testing of the
test spend their time completing the final testing of their projects. You might solution to a challenging
wish to spread this lesson over two lessons if needed, or allow for problem
homework time to finish if appropriate.
Lesson 50: Battle boats This is the final lesson of the eight lesson project and the final lesson of ● Evaluate a challenging
evaluate the unit. Learners will spend time evaluating their progress against the program
original scenario given. They should reflect on their strengths and
challenges through the completion of their solutions. Finally, learners
will submit their projects ready for marking.
Progression
This unit progresses learners’ knowledge and understanding of programming.
Vocabulary
Vocabulary sheets have been provided for each lesson. These can be given to learners in advance of the
lesson to familiarise themselves with the key terms used in the lesson. A full list of the vocabulary definitions
can be found in the vocabulary spreadsheet.
Curriculum links
National curriculum links
● Develop their capability, creativity, and knowledge in computer science, digital media, and information technology
● Develop and apply their analytic, problem-solving, design, and computational thinking skills
Assessment
Summative assessment
● Battle boats scenario
Assessment rubric
● Battle boats rubric
Subject knowledge
This unit focuses on GCSE-level programming.
Enhance your subject knowledge to teach this unit through the following training opportunities:
Development environment
Before delivering this unit, you will need to decide on which development environment you will be using. You can use a local installation
of a Python interpreter and a learner-friendly IDE, such as the mu editor (codewith.mu), or you can use an online development
environment such as repl.it. You can, of course, use both, but that may be confusing for your learners.
Here are some of the things that you should consider before making your decision:
● Conceptual understanding: An interpreter is necessary in order to translate and execute any Python program. An elementary
conceptual understanding of what happens when the interpreter is invoked is necessary for learners.
○ Local: In a local installation, the interpreter is invoked through the development environment. Learners will probably be
able to grasp that the interpreter (as well as their Python program) is executed on their computer.
○ Online: Learners access an online development environment through their browser, and the interpreter (as well as their
Python program) is executed on a remote computer. This may make it more complicated for learners to develop a
conceptual understanding of the translation and execution process.
● Code distribution: In many cases, you will need to provide Python code to the learners (e.g. as a starting point for a programming
activity).
○ Local: Consider how convenient it will be to distribute .py files to your learners in your particular circumstances.
○ Online: If you use an online development environment, distributing code is usually as simple as providing a link.
● Code collection: It will probably be necessary for learners to submit (some of) their code to you, especially for assessment.
○ Local: Consider how convenient it will be to collect .py files from your learners in your particular circumstances.
○ Online: If you use an online development environment, collecting code will usually involve receiving a link from learners.
● Module installation: In some cases, you may need to install additional Python modules.
○ Local: Consider how convenient it will be to install additional Python modules in your particular circumstances.
○ Online: If you use an online development environment, a lot of additional modules are readily available. However, not all
Python modules can be used through online environments.
● Network access: On occasion, some of the example code provided requires internet access (making use of web API’s to retrieve
information).
○ Local: In case of a local Python installation, you will need to consider (or test) if this is possible in your particular
circumstances.
○ Online: This should not be an issue when using an online development environment.
Resources are updated regularly - the latest version is available at: the-cc.io/curriculum.