0% found this document useful (0 votes)
81 views28 pages

On Track Scheme of Work Unit 4293 - Programming For A Purpose - For Assessment From January 2019

This document provides a scheme of work for teaching the Cambridge ICT Starters On Track module "Programming for a Purpose". It outlines the learning objectives, assessments, and recommended resources. Suggested activities are provided to teach each learning objective, including planning interactive programs using flowcharts and creating programs using inputs, outputs, and selection structures. Guidance is given on safety, permissions, and integrating eSafety topics.

Uploaded by

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

On Track Scheme of Work Unit 4293 - Programming For A Purpose - For Assessment From January 2019

This document provides a scheme of work for teaching the Cambridge ICT Starters On Track module "Programming for a Purpose". It outlines the learning objectives, assessments, and recommended resources. Suggested activities are provided to teach each learning objective, including planning interactive programs using flowcharts and creating programs using inputs, outputs, and selection structures. Guidance is given on safety, permissions, and integrating eSafety topics.

Uploaded by

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

Scheme of Work – Cambridge ICT Starters On Track, Programming for a

Purpose

Introduction
This document is a scheme of work created by Cambridge International as a suggested plan of delivery for the Cambridge ICT Starters Initial Steps
module ‘Programming for a Purpose’. Learning objectives for the module have been arranged in a recommended teaching order but you are free to
teach them in any order to suit your local requirements and resource availability.

Several suggested activities have been given for each learning objective. Some are short introductory or revision activities and some are more
substantial learning activities. You need to choose a variety of activities that will meet the needs of your learners and cover all of the requirements of
the learning objectives. You will need to decide on the teaching time necessary for each activity, both to suit the pace of your learners and to fit the
work comfortably into your own term times.

Suggested approaches on integrating teaching on eSafety and ethical behaviour have been included. You will need to adapt these to be suitable for
the age of your learners and to include information about local policies and laws.

There is no obligation to follow the published Cambridge International scheme of work in order to deliver Cambridge ICT Starters. This document has
been created solely to provide an illustration of how delivery of this module might be planned.

Overview
The Programming for a Purpose module is part of the On Track certificate. The progression of modules that relate to this topic are shown in the table
below.

Initial Steps Next Steps On Track

Starting Programming Exploring Programming Programming for a Purpose

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose


On Track, Stage 3 module: Programming for a Purpose
In this module, learners will continue developing their programming knowledge through exploring the use of inputs, outputs and selection. They will
plan interactive programs using flowcharts and write related programs, which are thoroughly tested using a range of inputs. Learners will also predict
the output and correct (debug) interactive programs. They will enhance their programs with additional functionality and ensure that they are formally
tested. Options have been provided in this Scheme of Work to enable learners to continue their on-screen programming in Scratch or to begin to use
a text based programming language (Python) in preparation for further study.

What is assessed in this module?


Learners will demonstrate how to:
 plan an interactive program using abstraction
 create and test an interactive program using selection, input and output
 predict the output of an interactive program that uses input and selection
 create and formally test an interactive program using selection, input and output
 correct (debug) a short interactive program containing more than one error.

What do you need to teach this module?


To teach this module you will need:
 access to the example flowcharts and test table (appendices A–D)
and either:
 access to the scratch 3 website at http://scratch.mit.edu/ or an offline version downloaded from https://scratch.mit.edu/download. Scratch is
developed by the Lifelong Kindergarten Group at the MIT Media Lab
 access to an online Python 3 editor, such as trinket.io https://trinket.io/python3 or an offline version downloaded from
https://www.python.org/downloads/.

Underpinning knowledge
Before commencing this module it is recommended that learners know:
 have completed the Next Steps module ‘Exploring Programming’ or know how to create simple programs using repetition and procedures
 how to access a website using a url (web address)
 multiplication tables up to 12 x 12
 flowchart symbols for starting and ending instructions (oval shape), a decision (diamond shape) and a process step (rectangle).

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 2


General Principles and Procedures
The following are further suggestions and considerations:
 Learners may produce flowcharts without the aid of a computer, although they may prefer to use the shape tools within a word processor or
graphic design software. A word processor could also be used to facilitate the completion of a test table.
 The symbols used within flowcharts follow the ISO standard. Flowcharts are usually read from top to bottom and left to right.
 Scratch 3 is available in over 50 languages. The language can be altered by clicking on the Globe icon in the top left corner of
the screen.
 It is advisable to download the offline version of Scratch 3 from https://scratch.mit.edu/download which will enable the programming
environment to be used when an Internet connection is unavailable.
 If the internet is used for this module, provide a simple explanation of browser software, and how to use it safely.
 Learners will benefit from experimenting with instruction blocks in Scratch to discover their functionality.
 During programming activities, encourage learners to assist each other and to share their programming knowledge with their peers.
 Specific time should be set aside for learners to develop their own sprites and backgrounds if required.
 Learners may wish to move to a text based programming environment if they are already proficient with implementing basic programming
concepts, such as sequencing, selection, repetition and variables, within Scratch.
 It is advisable to download the offline version of Python 3 https://www.python.org/downloads/ which will enable the programming environment
to be used when an Internet connection is unavailable.
 If using a text based programming environment, such as Python, learners should be encouraged to discuss the similarities and differences
when compared to a block based programming environment, such as Scratch.

eSafety guidance
 We recommend that each school has an Acceptable Use Policy (AUP) which describes the activities that learners can, and cannot, do when
using the internet in lessons.
 Explain to learners what they should do if they feel unsafe or if inappropriate content is evident on their device. This can be integrated with age-
appropriate teaching on topics such as ‘stranger danger’ and bullying.
 Learners should be given guidance as to what content is appropriate to include within their interactive programs and care should be taken to
ensure this is suitable for the age of the learners.
 For this module, learners that are using Scratch may wish to share their programs on the community’s website. It is advisable to obtain
permission from parents or guardians before allowing this. Guidance should also be given on appropriate online behaviour, including the
importance of following the community’s guidelines. Teachers may wish to setup a ‘Scratch teacher’ account to manage their learners’
programs online. Further information can be found at https://scratch.mit.edu/educators/faq.
 Further information about learner safety and responsibility can be found in section 5 of the Syllabus.

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 3


Learning Suggested activities to choose from Resources Comments
Objective

Plan an Planning an interactive program


interactive
program using  The following activities will introduce learners to interactive
abstraction sequences of instructions and will allow them to plan a
program that includes both inputs and outputs.

 Ask learners to name as many technology devices as


possible that contain a computer. Encourage them to think
beyond typical computing devices, such as laptops, and to
include items such as washing machines, calculators and
digital alarm clocks.

 Explain that each correct suggestion contains a computer


program and discuss the inputs that the device uses, for
example an alarm clock allows the user to set the current
time and the time when the alarm will sound. Also explain
what the outputs are, for example an alarm clock has a
digital display showing the time and a buzzer that makes a
sound when the alarm goes off.

 Explain that learners are going to create a program involving


an output, or information displayed on the screen, which is
determined by an input, or information entered by the user.
Also discuss other inputs, such as a mouse, pressure pad or
tilt sensor, and other outputs, such as speakers, headphones
or a printer.

 Explain that learners are going to pretend to be the computer Computing unplugged activities
by using an unplugged activity. are those which take place away
from the machines without the
Display the following written instructions and explain that the use of technology.
“word” is the input, whilst the actions of “clap hands” or
“stamp feet” are the output:

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 4


if word = ‘cheese’ then
clap hands
else
stamp feet

Ask learners to discuss the “if”, “then” and “else” instructions


and explain that these enable the computer to use selection,
or to make a decision, based on the user’s input. After a few rounds of this
activity, you could say the word
Say a number of words, including “cheese” and ensure for ‘cheese’ in another
learners respond using the correct action. Explain that the language. This will enable
computer will only do the specific instructions it is told to learners to discuss how the
undertake based on the input, so it is important that the code computer would respond.
within our programs is exact.

 Explain that learners are going to produce a game that will


help younger children to learn their multiplication tables.

 Ask them to discuss how the program could work and what
information the user would need to enter, the input, what
’decision’ the computer would need to make and what it
would need to then display, the output. The responses
should include the following:
The multiplication question for the young
Output learner to answer.
The young learner’s answer to the
Input
question.
Decision Is the answer the user has input correct?
The response based upon whether a
Output correct or incorrect answer has been
‘input’.

 Explain that abstraction has been used to think about the


program. Abstraction involves filtering out unnecessary
information to focus on the problem that needs to be solved.

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 5


In this example, we haven’t included information about the
need to start the program, about the instructions we might
display on screen, or even about the need to initially turn on
the computer.

 Explain that we can use flowcharts to plan our program.


Show learners the symbol for inputs / outputs, which allows
us to more specific about the functionality of our program:

 Show learners an example of the text that could be included


within an input / output block, for example:

Output text Output - Display multiplication question


Input - Type answer to multiplication
Input text
question
Learners may also wish to plan
 Working in pairs, learners should produce a flowchart for the  Example flowchart their program using pseudo-
(See Appendix A) code.
multiplication game, based upon one multiplication question.
An example of what the flowcharts should look like has been
provided, see Appendix A. Each pair should then contribute
to a class discussion to produce an agreed version of this
flowchart. Address any misconceptions that arise during this
discussion.

 Explain that learners are now going to produce a flowchart


for a different program. Outline how a scientist wants to
check whether a temperature entered in Fahrenheit is below
freezing (zero degrees Celsius, which is 32o Fahrenheit).
Ask learners to discuss the inputs and outputs:

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 6


The prompt to enter a temperature in
Output Fahrenheit
Input The temperature in Fahrenheit
Is the temperate the user has input below
Decision
32oF?
The response based upon whether
temperature in Fahrenheit input is below
Output
freezing (zero degrees Celsius, which is
32o Fahrenheit).

 Remind learners of the flow charts symbol for input / output


and ask them to produce their own flowchart. Encourage
them to obtain feedback from their peers and to debug their
programs as required.
Create and test Introducing selection, inputs and outputs using a block based Depending upon the prior
an interactive programming environment knowledge of learners, they may
program using now wish to begin using a text
selection, input  The following activities will enable learners to begin  Scratch 3.0 can be based language for on-screen
and output implementing selection within Scratch. They will use their accessed at programming. In order to assist
flowcharts from the previous activity to produce their http://scratch.mit.edu with this, the tasks included
Predict the output programs. or an offline version within this group of activities
of an interactive downloaded from have been reproduced in
program that uses  Remind learners of their unplugged task from the previous https://scratch.mit.edu/ Appendix E, but with the
input and group of activities and demonstrate the “if, then, else” block download instructions based upon Python
selection within the “Control” block palette. Explain that this block rather than Scratch.
allows the inclusion of selection, or a decision, based on an
input. If time allows, the learners could
also work through the activities
in Scratch and then repeat them
in Python, before discussing the
differences between the two
experiences.

 Example Scratch
Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 7
 Display the example program ‘ot_example1.sb2’ and ask program:
learners to predict the program’s output by working through ot_example1.sb2
each instruction block in order. Demonstrate inputting a
range of text, including “left”, “right”, “lft” and “move” and
discuss the program’s behaviour.

 Draw learners’ attention to the “ask and wait” block in this


program. Explain that this block can be found in the
“Sensing” block palette and discuss the block’s functionality.

 Remind learners of the flowchart that was agreed in the last


group of activities for making a multiplication quiz. Explain
that the “ask and wait” block can be used to ask a question,
for example:

 Display the “answer” block from the “Sensing” block palette


and the “=” block from “Operators”. Ask learners to discuss
each block’s functionality and explain that “answer” is a
variable. A variable is a way to store information in the
computer’s memory and contains the answer typed in, or
input, by the user.
 Example Scratch Ensure the “answer” block is
 Display the example Scratch program ot_example2.sb2 and program: located the first hole of the “=”
ask learners to discuss how the blocks could be arranged to ot_example2.sb2 block. The hole of the “=” block
check whether the answer is correct. will expand once the “answer”
block is correctly positioned.
 Explain that the program needs to output a suitable response
that is dependent upon the answer that has been input by
the user. Explain that the “say _____for __ secs” block is an
example of an output in a Scratch program.

 Display the correct set of instructions, as follows:

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 8


 Ask learners recreate this set of instructions and to ensure it
functions as expected for both correct and incorrect answers.

 Explain that programmers will regularly test a small section


of a program once it has been written, before they move on
to creating the next stage. This and is known as the “iterative
development process”. Explain that the learners will now be
adding further stages to their own programs by adding a
second question to their multiplication quiz, therefore it is
important to check that the current stage works correctly
before proceeding.

 Show learners the blank test table (Appendix B) and ask


them to discuss how they could complete it for their program
so far. Demonstrate how to complete the table for a correct
answer using the information below.  Appendix B - Blank
Test case Input Expecte Actual Notes test table document
data d output output
Correct response 10 Well To be To be completed
displayed when done! completed if additional
right answer after test information is
entered required after
test

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 9


 Provide learners with a copy of the template for the test table
and ask them to add the above information to it and to then
complete the information for an incorrect answer.

 Demonstrate how to use the “Duplicate” function in Scratch,


by right clicking on the “ask and wait” block and selecting the
top option from the menu.

 Learners should alter the question and the answer within the
duplicate in their program to produce an additional question. When testing, encourage
learners to work through each
 Ask learners to repeat the process of testing their program instruction in turn to determine
and to ensure that the second question functions as where an error takes place or to
expected. Also ask them to test a peer’s program and to describe to a peer the intended
ensure their test data is correct. They should “debug”, or fix, functionality of each instruction,
any errors that are identified. as oral description can also help
to identify errors.
 Learners should ensure they save their work or download
the file to their computer, which will ensure they are able to It might be necessary to remind
enhance their program in later activities. learners how to save their work.
This can be done using the
“Save” option (in the offline
version of Scratch) or the
“Download to your computer”
option (online version) from the
“File” menu.

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 10


Predict the output Predict and debug interactive programs
of an interactive
program that uses  The following activities will enable learners to debug
input and programs and to predict their outcomes using flowcharts.
selection
 Show learners the example flowchart (Appendix C) and ask  Example flowchart
Correct (debug) a them to discuss the algorithm’s functionality. Ask them to (See Appendix C)
short interactive work through each symbol of the flowchart systematically
program and discuss what will happen at each stage. Address any
containing more misconceptions.
than one error
 Explain that the first question the program will ask, or output,
is, “What is the capital city of France?”. Show learners the
following range of inputs and ask them to discuss in pairs the
program’s output once the text has been entered:
- London
- Pari
- Paris
- 123456
- Aris
- Prais
- David
- Paris France

 Discuss why “Paris” is the only input displaying the correct


answer text. Remind learners that computers will only
undertake the exact instructions within the algorithm.

 Remind learners that algorithms occasionally contain errors


and the process of fixing those errors is known as
’debugging’.

 Display the flowchart to determine whether a person is


permitted to go on a fairground ride (Appendix D). Explain  ‘Fairground’ flowchart
that many fairground rides are only suitable for people over a (See Appendix D)
certain height, due to safety considerations, and that this

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 11


flowchart is a program which will determine whether a
person is tall enough. Ask learners to work through the
flowchart systematically and to discuss whether it functions
as expected.

 Take feedback from learners and ask them to work through


the program and discuss the output once the following data
has been input:
- Ride name – Spinner
- Height limit in cm – 112
- Name of person – David
- Height of person – 103

 Discuss the actual output and where the bugs are within the
algorithm. If necessary, explain there are two errors:
- The “<” operator is incorrect, as it currently only
allows people smaller than the height limit to go on
the ride. It should be altered to an “>” operator.
- The output text is incorrect, as it currently states the
“name of the ride is able to go on name of person”. It
should read the “name of person is able to go on
name of ride”

 Ask learners to work in pairs to produce a correct version of


this flowchart.
Create and Enhancing and formally testing an interactive program using a The tasks included within this
formally test an block based programming environment group of activities have been
interactive reproduced in Appendix F, but
program using  The following activities will ensure that learners’ programs with the instructions based upon
selection, input are fully tested. Programs are also enhanced using functions Python rather than Scratch.
and output that will enable learners to recall their prior knowledge.
If time allows, the learners could
 Explain that learners are now going to enhance and  Learners multiplication also work through the activities
thoroughly test their multiplication program from the previous programs that were in Scratch and then repeat them
activities. Ask them to open their work or upload the file from created earlier in the in Python, before discussing the
their computers. module. differences between the two

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 12


experiences.
 Remind learners of the test table that they used to test these
programs previously. Explain that they now need to carry out  Test table document
more thorough tests, using a wider range of inputs. Show from earlier activities
learners the following definitions and examples:
- Normal values – usual, expected data (e.g. “5” and
“8”)
- Extreme values – unusual or unexpected data, such
as very high or low values (e.g. “-34” or
“345345635634636”)
- Erroneous values – data of the wrong type (e.g.
“David” or “donkey”)
Test case Input Expecte Actual Notes
data d output output
Normal values - 10 Well To be To be completed
correct response done! completed if additional
displayed when after test information is
right answer required after
entered test
Extreme values – -34 Unlucky To be To be completed
correct response completed if additional
displayed when after test information is
wrong answer required after
entered test
Ensure the “answer” block is
 Enter the above information with learners into the test table located the first hole of the “=”
and ask learners to work in pairs to complete the remainder block. The hole of the “=” block
of the table, for the Erroneous values. will expand once the “answer”
block is correctly positioned.
 Ask learners to discuss how their program’s output could be
enhanced, for example by:
- Offering a more encouraging response if the input
answer is close to the correct response and a
different response for answers that are more
extreme.
- Making the Sprite move or spin to ‘celebrate’ a
correct answer.
- Investigating other blocks, such as those in the

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 13


‘sound’ palette, or changing the sprite and / or
backdrop throughout the program.

 Explain that the program could also be enhanced through


the inclusion of a score display, which would increase each
time a question is answered correctly.

 Demonstrate the “Make a variable” button from within the


“Data” block palette. Explain that a variable is a way for the
computer to store data, which could be text based, such as
the user’s name, or number based, such as a timer. The
value of the variable can change, or vary, hence the name,
“variable”.

 Demonstrate how to give the variable a suitable name, such


as “Score”. Emphasise how the value of the variable can be
seen as the numbers change within the ‘Score’ box on the
screen.

 Explain that we need to initialise, or “set”, the score to zero


at the start of the program and increase, or “change”, the
score by one if the user answers the question correctly.

 Show learners the example program “ot_example3.sb2” and


highlight the location of the “set” and “change” blocks.  Example Scratch
Discuss where the additional “change” blocks need to be program:
added (above the “say Well done! for 2 secs” blocks for ot_example3.sb2
questions 2 and 3) and insert the blocks as a class.

 Allow learners time to experiment by using more of the


scripts provided in Scratch. They will have already used
several of the ‘motion’, ‘looks’ and ‘events’ blocks in previous
modules. This is an opportunity for them to explore the other
functions available, for example timers, date/time indicators,
sound and random number generators.

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 14


 Discuss how the Maths Quiz program could be adapted to
use more of the scripts in Scratch. Encourage learners to be
creative and use as many scripts as possible – while still
making a working programme. Possibilities would include
adding a timer to ensure answers are inputted quickly, using
a random number generator to create a wide range of When testing, encourage
questions or adding a sound to indicate a correct answer. learners to work through each
instruction in turn to determine
 Ask learners to plan the next parts of their program, which where an error takes place or to
should include additional outputs and functionality, using describe to a peer the intended
either a flowchart or pseudocode. functionality of each instruction,
as oral description can also help
 Learners should enter their instructions for their program into to identify errors.
Scratch. They should ensure that each section is functioning
correctly before moving on to the next part of their program. It might be necessary to remind
learners how to save their work.
 Once complete, ask learners to update their test table to This can be done using the
include the program’s new functionality. Encourage learners “Save” option (in the offline
to test a peer’s program and to ensure their test data is version of Scratch) or the
correct. If required, learners should debug their program. “Download to your computer”
Encourage them to work through each instruction in turn to option (online version) from the
determine where an error takes place, or to describe to a “File” menu.
peer the intended functionality.

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 15


Assessment ideas
To show how the Assessment idea fully incorporates the learning objectives tested, the assessment idea is cross-referenced with the learning
objective table below.

Assessment Idea One


Learners should plan an interactive program using a flowchart, which could be based either on a design brief or their own ideas (1). Learners should
produce a basic, working, interactive program, which is error free and includes a test table to show evidence of testing (2). Learners should add
additional features to their program to enhance their program and includes evidence of further testing with normal, extreme and erroneous values (4).

Learners should be given a flowchart for an interactive program and asked to predict the output following the input of data (3). Learners should be
given a flowchart containing more than one error and asked to debug the instructions (5).

Stage
1 Plan an interactive program using abstraction
2 Create and test an interactive program using selection, input and output
3 Predict the output of an interactive program that uses input and selection
4 Create and formally test an interactive program using selection, input and
output
5 Correct (debug) a short interactive program containing more than one error

Teachers should retain the following evidence for moderation:


 Learner flowcharts
 Learner Scratch programs

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 16


Exploring Programming – Appendix A
A flowchart of instructions for an interactive program

Start

Output – Display
the multiplication
question

Input – Type the


answer to the
multiplication
question

Does the input answer = the


multiplication question answer?

YES NO

Output – Display Output – Display


that the question that the question
has been answered has been answered
correctly incorrectly

End

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose


Exploring Programming – Appendix B

Test table template

Expected
Test case Input data Actual output Notes
output

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 18


Exploring Programming – Appendix C
Flowchart of instructions for a prediction activity.

Start

Output – What is
the capital city of a
specific country?

Input – Type the


answer to the
capital city question

Does the input answer = the capital


city question answer?

YES NO

Output – Display Output – Display


that the question that the question
has been answered has been answered
correctly incorrectly

End

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose


Exploring Programming – Appendix D
Flowchart of instructions for a program which determines whether a child is tall enough to be
able to use a fairground ride.

Start

Output – What is
the name of the
fairground ride?

Input – Type the


name of the
fairground ride

Output – What is
the ride’s height
limit?

Input – Type the


height limit of the
ride in cm

Output – What is
the person’s
name?

Input – Type the


name of the
person

Output – What is
the person’s
height?

Input – Type the


height of the
person

Is height input < the ride


Yes height limit? No

Output – Name of Output – Name of


ride is able to go on ride is not able to go
name of person on name of person

End

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose


Exploring Programming – Appendix E

Activities to introduce learners to using a text based programming language for creating an interactive program.

Learning Suggested activities to choose from Resources Comments


Objective

Create and test an Introducing selection, inputs and outputs using a text based
interactive program programming environment
using selection,
input and output
 The following activities will enable learners to begin  Example flowchart
implementing selection within Python. For these activities (See Appendix A)
Predict the output
of an interactive
they will need to refer to the flowchart for a multiplication
program that uses game (appendix A)
input and selection
 Show learners the Python interface and explain that they will  trinket.io online Python An offline Python editor can be
now need to type in commands, or instructions, rather than 3 editor is available at: downloaded from:
by dragging blocks together. https://trinket.io/python https://www.python.org/downloa
3 ds/
 Demonstrate typing in the “print” command to output text to
the screen and emphasise the importance of spacing, capital
/ lower case letters and punctuation. Explain that this forms
Python’s ’syntax’, or the set of rules defining the combination
of symbols in a language. An example of what could be
typed would be as follows:

 Run the program to demonstrate the program’s output. Within trinket.io the run button is
in the row of buttons at the top of
 Ask learners to experiment with displaying different text to the editor.
the screen. Encourage them to assist each other with
debugging their work and discuss how this is different or
similar to debugging with block based programming
Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 21
languages.
The program’s output is
 Remind learners of their previous work on inputs and outputs displayed in the right hand
in programming and explain that, in Python, the “input” window of trinket.io
command is used to allow the user to type in text. Explain
that the user’s answer is then stored using a variable, which If there are errors in the
is a way to store information in the computer’s memory. For program, Python may display a
the purposes of the following demonstration the variable has “Syntax Error”. Learners should
been called “answer” but any word could be used as long as read the error message carefully
it matches what is then used in the selection command. It is and examine the line the error
however important that the chosen word reflects what the occurred on.
variable is intended to be used for as this will make testing
and debugging easier.

 Ask learners to enter the following command and ensure


they are able to type in an answer using the keyboard.

 Remind learners of the flowchart that was agreed for making


a multiplication quiz. Explain that selection, or a decision,  Example flowchart
can be added to a program in python using an “if, else” (See Appendix A)
command. Display the following instructions and ask
learners to predict the program’s functionality:

 Draw learner’s attention to the colon and explain that this


identifies the start of the “if, else” statement.

 Emphasise that the “print” command is now indented within


the “if, else” blocks and that “==” checks to see if two values
are equal. Ask learners to enter the above commands and to

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 22


check whether their program functions as predicted for both
correct and incorrect answers.

 Explain that instructions that are not part of the “if, else”
statement should not be indented. Therefore it may be
necessary to remove the indentation before entering the next
command.

 Explain that programmers will regularly test a small section


of a program once it has been written, before they move on
to creating the next stage. This and is known as the “iterative
development process”. Explain that learners will now be
adding further stages to their own programs by adding
questions to their multiplication quiz, therefore it is important
to check that the current stage works correctly before
proceeding,

 Show learners the blank test table (Appendix B) and ask


them to discuss how they could complete it for their program  Appendix B - Blank
so far. Demonstrate how to complete the table for a correct test table document
answer using the information below.
Test case Input Expecte Actual Notes
data d output output
Correct response 10 Well To be To be completed
displayed when done! completed if additional
right answer after test information is
entered required after
test

 Provide learners with a copy of the template of the test table


and ask them to add the above information to it and to then
complete the information for an incorrect answer.

 Demonstrate how to use the copy and paste functionality


within Python. Learners should copy the following code,

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 23


paste it below their existing question, then alter the question Instructions can be copied and
text and answer, which will allow them to add a second pasted in Python by highlighting
question without manually entering the code again. the required content and then
using right click “copy” in the
same way as is done in a text
document.

 Ask learners to repeat the process of testing their program


and to ensure that the second question functions as
expected. Also ask them to test a peer’s program and to
ensure their test data is correct. They should “debug”, or fix,
any errors that are identified.

 Learners should ensure they save their work or download


the file to their computer, which will ensure they are able to
enhance their program in subsequent sessions.

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 24


Exploring Programming – Appendix F

Activities to for enhancing and testing interactive programs in a text based programming language.

Learning Suggested activities to choose from Resources Comments


Objective

Create and formally Enhancing and formally testing an interactive program using a
test an interactive text based programming environment
program using
selection, input and
 The following activities will ensure that learners’ programs trinket.io online Python 3
output
are fully tested. Learners will also be given the opportunity to editor is available at:
enhance the programs that they created in Python. https://trinket.io/python3

 Explain that learners are now going to enhance and An offline Python editor
thoroughly test their multiplication program from the previous can be downloaded from:
activities. Ask them to open their work or upload the file from https://www.python.org/do
their computers. wnloads/

 Remind learners of the test table that they used to test their
programs. Explain that they now need to more thoroughly
test their programs, using a wider range of inputs. Show
learners the following definitions and examples:
- Normal values – usual, expected data (e.g. “5” and
“8”)
- Extreme values – unusual or unexpected data, such
as very high or low values (e.g. “-34” or
“345345635634636”)
- Erroneous values – data of the wrong type (e.g.
“David” or “donkey”)
Test case Input Expecte Actual Notes
data d output output
Normal values - 10 Well To be To be completed
correct response done! completed if additional
displayed when after test information is
right answer required after
Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 25
entered test
Extreme values – -34 Unlucky To be To be completed
correct response completed if additional
displayed when after test information is
wrong answer required after
entered test

 Enter the above information with learners into the test table
and ask learners to work in pairs to complete the remainder
of the table, for the Erroneous values.

 Demonstrate how to include variables within output text in


Python and ask learners to enter the following instructions,
which allows the user’s incorrect answer to be displayed:

 Ask learners to discuss how their program’s output could be


enhanced further, such as by:
- displaying the correct answer if an answer was entered
incorrectly:

- asking the user to input their name at the start of the


program and displaying it within text output throughout
their program

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 26


 Explain that the program could be further enhanced through
the inclusion of a score counter which would increase when
a question is answered correctly. Explain that we again need
to use a variable to store this information.

 Demonstrate how to give the variable a suitable name, such


as “Score” and explain we need to initialise the score to zero
at the stage of the program.

 Explain that we can then increase, or increment, the score


by one if the user answers the question correctly.

 Discuss where learners should enter these instructions and


ask them to implement the score functionality in their own
program, such as: Learners may also wish to
display the user’s overall score
at the end of their program as
an additional feature. This could
be done by adding the following
command to the end of the
program:

 Allow learners time to experiment by using further Additional functions can be


programming options that are available in Python. This is an inserted into Python programs
by importing ‘modules’. Further
Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 27
opportunity for them to explore the other functions, for information about modules can
example timers, date/time indicators, sound and random be found at:
number generators. https://www.learnpython.org/en/
Modules_and_Packages
 Discuss how the Maths Quiz program could be adapted to
use some of the modules in Python. Encourage learners to As an example, a random
be creative and use as many options as possible – while still number generator can be
making a working programme. Possibilities would include included into a Python program
adding a timer to ensure answers are inputted quickly, using by entering the following
a random number generator to create a wide range of commands:
questions or adding a sound to indicate a correct answer.

 Ask learners to plan the next parts of their program, which


should include the additional outputs and functionality that
were discussed earlier, by using either a flowchart or
pseudocode.

 Learners should enter their instructions for their program into


Python. They should ensure that each section is functioning
correctly before moving on to the next part of their program.

 Once complete, ask learners to update their test table to


include the program’s new functionality. Encourage learners
to test a peer’s program and to ensure their test data is
correct. If required learners should debug their program.
Encourage learners to work through each instruction in turn
to determine where an error takes place, or to describe to a
peer the intended functionality.

Scheme of Work – Cambridge ICT Starters On Track, Programming for a Purpose 28

You might also like