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

Edexcel Computer Science SAMPLE PAGES

Uploaded by

Shams Zubair
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)
460 views

Edexcel Computer Science SAMPLE PAGES

Uploaded by

Shams Zubair
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/ 24

EDEXCEL ComputEr SCiEnCE for GCSE

Computer
SCienCe
SAMPLE
CHAPTERS

Steve Cushing
Meet the challenges of the new GCSE specification with print and digital resources
to support your planning, teaching and assessment needs alongside specialist-led CPD
events to help inspire and create confidence in the classroom.
We will be seeking endorsement for the following textbook :
Edexcel GCSE Computer Science Student Book   9781471866227   June 2016  £19.99
Visit www.hoddereducation.co.uk/ComputerScience/GCSE/Edexcel to pre-order your class
sets, or to sign up for your Inspection Copies or eInspection Copies.

Also available:

Edexcel GCSE Computer Science Dynamic Learning


Dynamic Learning is an innovative online subscription service with interactive resources, lesson planning tools, self-
marking tests, a variety of assessment options and eTextbook elements that all work together to create the ultimate classroom
and homework resource.
“I’d have no time left to teach if I collected all these resources. It’s a great time saver.”
Caroline Ellis, Newquay Tretherras
9781471886621  February 2017  £8.99
To sign up for a free 30-day trial, visit www.hoddereducation.co.uk/dynamiclearning

My Revision Notes: Edexcel GCSE Computer Science


Ensure your students have the knowledge and skills needed to unlock their full potential with this revision guide from our
best-selling series.
Prices from £9.99
Pub date: January 2017
To sign up for Inspection Copies visit www.hoddereducation.co.uk/ComputerScience/GCSE/Edexcel

Philip Allan Events


Ensure that you are fully prepared for the upcoming changes by attending our specialist-led CPD courses.
For more information and to book your place visit www.hoddereducation.co.uk/Events
EDEXCEL Computer Science for GCSE

Computer
Science

Steve Cushing
Although every effort has been made to ensure that website addresses are correct at time of going
to press, Hodder Education cannot be held responsible for the content of any website mentioned. It
is sometimes possible to find a relocated web page by typing in the address of the home page for a
website in the URL window of your browser.
Hachette UK’s policy is to use papers that are natural, renewable and recyclable products and made
from wood grown in sustainable forests. The logging and manufacturing processes are expected to
conform to the environmental regulations of the country of origin.
Orders: please contact Bookpoint Ltd, 130 Milton Park, Abingdon, Oxon OX14 4SB. Telephone:
(44) 01235 827720. Fax: (44) 01235 400454. Lines are open 9.00–17.00, Monday to Saturday, with a
24-hour message answering service. Visit our website at www.hoddereducation.co.uk
© Steve Cushing 2016
First published in 2016 by
Hodder Education
An Hachette UK Company,
Carmelite House
50 Victoria Embankment
London EC4Y 0DZ
All rights reserved. Apart from any use permitted under UK copyright law, no part of this publication
may be reproduced or transmitted in any form or by any means, electronic or mechanical, including
photocopying and recording, or held within any information storage and retrieval system, without
permission in writing from the publisher or under licence from the Copyright Licensing Agency
Limited. Further details of such licences (for reprographic reproduction) may be obtained from the
Copyright Licensing Agency Limited, Saffron House, 6–10 Kirby Street, London EC1N 8TS.
Cover photo © Antonis Papantoniou – Thinkstock.com
Contents

Contents
Section one: Problem solving
1 Computational thinking
2 Using flowcharts
3 Pseudo-code

Section two: Programming


4 Mathematical skills in computer science
5 Loops and mathematical operations
6 Variables and constants
7 Programming in code
8 Iteration and selection
9 Boolean and logic gates
10 Structuring programs in a modular way
11 Subroutines
12 Testing your code
13 Algorithm efficiency
14 Comparing pseudo-code, flowcharts and code

Section three: Data


15 The language computers actually use
16 Binary and hexadecimal numbers
17 Computing and data representation
18 Data types and structures
19 Data structures
20 Data and program validation and verification
21 Data size, storage and compression
22 Databases
23 Reading and writing to a text file
24 Encryption
25 Understanding search and sort algorithms

6
Section four: Computers
26 The computer systems architecture
27 Memory
28 Secondary storage
29 Cloud computing
30 Fetch-Decode-Execute cycle
31 Software

Section five: Communication and the Internet


32 Networks
33 Network data transfer

Section Six: Emerging trends, issues and impact


34 Personal vulnerabilities
35 Social engineering and cyber security
36 Ethics and the law
37 Embedded systems

Section seven: Set practical project


38 Project

7
2 Using flowcharts

   Specification references iteration) and using appropriate conventions


You should: (flowchart, pseudo-code, written description,
1.1.1 understand what an algorithm is, what draft program code)
algorithms are used for and be able to interpret 1.1.3 understand the purpose of a given algorithm
algorithms (flowcharts, pseudo-code, written and how an algorithm works
descriptions, program code) 1.1.4 understand how to determine the correct
1.1.2 understand how to create an algorithm to output of an algorithm for a given set of data
solve a particular problem, making use of 2.4.1 understand how to write code that accepts and
programming constructs (sequence, selection, responds appropriately to user input

  Key points There are a lot of different design procedures and techniques for
building large software projects. The technique discussed in this
▲ A flowchart is a diagram chapter, however, is for smaller coding projects and is referred to
representation of an algorithm. by the term ‘top down, structured flowchart methodology’. We
▲ For the examination, you will will explore how to take a task and represent it using a flowchart.
need to be able to interpret A flowchart puts the sentences from a sequence into shaped
flowcharts. boxes. The shapes indicate the action.
▲ Flowcharts are a graphical
You will know from the last chapter that a sequence is where a set
method of designing of instructions or actions are ordered, meaning that each action
programs. follows the previous action.
▲ A well-drawn flowchart is easy
to read.

  Key point
In a flowchart the lines express
the order of execution. Figure 2.1 A sequence

8
General rules for flowcharts

Flowchart advantages
● Flowcharts are a graphical way of writing pseudo-code.
● They are all standardised: we all pretty much agree on the
symbols and their meaning.
● They are very visual.

Flowchart disadvantages
● Flowcharts can be time consuming and difficult to modify.
● They need special software for symbols although some software
has these built in.
● The structured design elements are not all implemented.

General rules for flowcharts


● All symbols of the flowchart are connected by flow lines
  Key points (these must be arrows not lines to show direction).
▲ Flowcharts must have flow ● Flow lines enter the top of the symbol and exit out the bottom,
lines with arrows to show the except for the Decision symbol, which can have flow lines
order of execution. exiting from the bottom or the sides.
▲ An algorithm is a sequence of ● Flowcharts are drawn so flow generally goes from the top to

steps that can be followed to the bottom of the page.


complete a task. ● The beginning and the end of the flowchart is indicated using

▲ A sequence is where a set the Terminal symbol.


of instructions or actions are Let’s look at a simple sequence. Say we want to calculate A plus B,
ordered, meaning that each where A = 200 and B = 400.
action follows the previous
action. Start
A = 200 B = 400 Start
Add = 200 + 400
Output = 600
End
Action 1
We could create the simple flow­
chart shown in Figure 2.2.
Let's look at a another sequence,
  Task End
for example the sequence you carry
1 Produce a sequence to show out each morning in the bathroom.
Figure 2.2 A simple flowchart
how to brush your teeth. This sequence could be:
● Brush teeth
● Wash face
● Comb hair.
  Questions As you can see, sequences are a useful tool for showing what
1 What is a Terminator? happens and in what logical order, but each step, for example
2 What is a Sequence? ‘brush teeth’, needs to be defined in more detail to be carried out.
3 What is an Input/Output?

9
2 Using flowcharts

Once we have picked up our toothbrush, turned on the tap and


added the toothpaste we can put the toothbrush in our mouth and
brush. The act of actually brushing your teeth could be recorded
in a linear way (press, brush up, brush down, brush up, brush
down, etc.), but it would be much simpler to explain the brushing
once and then tell the user to repeat the same action x times. We
will explore this later when we consider looping (iteration), but for
now let us explore how we can use a flowchart to represent simple
sequences. First we need a few more elements.

  Key point
Cleaning your teeth is called a procedure in coding. You perform the
same action every day, for example: pick up brush, put toothpaste on
brush, brush teeth for two minutes, spit out, clean brush. These actions
could be given a procedure name: ‘Brushing Teeth’.

  Key points Basic elements of flowcharts


▲ You use a PROCESS symbol The flowchart symbols denoting the basic building blocks of
for an OPERATION or ACTION programming are shown in Figure 2.3 below. Text inside a symbol
STEP. is called a label.
▲ You use a TERMINATOR
symbol for a START or END in
a PROCESS.
▲ You use a DECISION symbol
START DECISION
for a QUESTION or BRANCH of
PROCESS
a process.
END
▲ Flowchart symbols contain text
called labels.
▲ For the examination, you will
need to understand how to
START END PROCESS DECISION
create an algorithm using a Symbol Symbol Symbol Symbol
flowchart.
Figure 2.3 Basic elements of a flowchart

The START symbol represents the start of a process.


The process symbol is labelled with a brief description of the
process carried out by the flowchart. The END symbol represents
the end of a process. It contains either ‘End’ or ‘Return’ depending
on its function in the overall process of the flowchart.

Representing a process
A PROCESS symbol is representative of some operation that is
carried out on an element of data. It usually contains a brief
description of the process being carried out on the data. It is
possible that the process could be even further broken down into

10
Basic elements of flowcharts

simpler steps by another complete flowchart representing that


  Key points
process. If this is the case, the flowchart that represents the
▲ Allflowcharts must have a process will have the same label in the ‘Start’ symbol as the
START and an END symbol. description in the ‘Process’ symbol at the higher level. A process
▲ The DECISION symbol will always has exactly one input arrow and one output arrow.
have exactly one input and two
In practice, sequences are not a simple line. Often the next action
outputs.
depends on the last decision. This is called selection. In selection,
one statement within a set of program statements is executed
depending on the state of the program at that instance. We ask a
question and choose one of two possible actions based upon that
decision.

Representing a decision
A DECISION/SELECTION symbol always makes a Boolean choice.
  Key points We will explore Booleans in more detail later in the book. The
▲ One of the most confusing label in a decision symbol should be a question that clearly has
things in a flowchart is telling only two possible answers to select from.
the loops apart from the
selections. This is because
both use the diamond shape
as their control symbol. Mark
No
them clearly. Condition
▲ A ‘Decision’ symbol always true?
makes a Boolean choice.
Yes

Figure 2.4 How to represent a decision

The DECISION symbol will have exactly one input arrow and two
output arrows. The two outputs will be labelled with the two
answers to the question, in order to show the direction of the
logic flow depending upon the selection made.
Selections are usually expressed as decision key words, such as ‘if
... then ... else ... endif, switch or case’. They are at the heart of all
programming.

Yes No
Condition
Then true? Else

Action 1 Action 2

  Questions
4 What is a flowchart?
5 What is a Selection?
Figure 2.5 A flowchart representing a selection

11
2 Using flowcharts

Flowcharts can use the following symbols:

Symbol Purpose Use


Flow line The lines show the
sequence of operations.

Terminal Denotes the start and end


Start (Start/Stop) of an algorithm.

Processing Denotes a process to be


carried out.
Delay
Alarm
Set for
rings Decision Used to represent the
5 mins
operation in which there
are two alternatives, true
and false.

Ready to No Hit Snooze We can use a decision to create a flowchart of what happens in
get up? button the morning on school days, as shown in Figure 2.6.
We also explored selections when we looked at the sequence
Yes of making tea. We explored using IF someone wants sugar and
IF someone wants milk. The process of making the tea differed
Climb out according to their answer to these questions.
of bed The flowchart below shows a different process for making tea and
adds two decision boxes.

End Yes
Start Boil kettle Milk? Add milk
Figure 2.6 A flowchart showing what
happens on a school morning No

Pour water
Find mug
in mug
Yes
Sugar? Add Sugar

No
Find
teabag Stir

Drink tea

Put teabag Remove


in mug teabag

End

Figure 2.7 A flowchart showing a difference process for making tea

12
Basic elements of flowcharts

If we wanted to show how to play the game of snakes and ladders


we could explain how to play the game in English as follows:
Start game
Throw the dice: the number indicated by dice is x.
Move your counter x squares on the board and check:
Have you landed on snakes head?: no/yes
If yes slide down snake to its tail.
If no check next statement
Have you landed on the bottom of the ladder?: no/yes
If yes move up the ladder.
If no check next statement
  Key point
Have you reached the last block of the game?: no/yes
Repetition is used when the
If yes
same bit of code is needed
several times. Instead of writing it Output “you are the winner”
over and over again, you can use If no
the REPEAT command. Repetition Give the dice to the next player
can also be called iteration Repeat until someone reaches the last block of the game.
(looping).
End
We have more decisions in this example and could show the game
with the following flowchart.

Start Give dice to


next player

Landed Yes
Slide down
on snake tail of snake
Throw dice head?

No

Move counter Landed Yes


Move up
number of places on bottom of
ladder
shown on dice ladder?

No
Output ‘You are
No the winner’
Reached
last square of
game?

Yes End

Figure 2.8 A flowchart showing the game of snakes and ladders

13
2 Using flowcharts

Other structures we will use in this book include:

SEQUENCE SELECTION INTERATION


Structure (IF…THEN…ELSE) (WHILE)
Structure Structure
Figure 2.9 Other structures we will use in this book

On-page and off-page connectors may also appear in some


flowcharts. This occurs when a flowchart goes over more than
one page. For the purposes of this chapter we will only explore
flowcharts that can be represented on a single page. If a flowchart
is so big it needs to go onto another page, you should split it into
sub-processes

Subprocesses
We can also use subprocesses in flowcharts using the symbol
below.

Subprocess

Figure 2.10 The subprocess symbol

Subprocesses are useful because:


● they help with the modularisation of complex programs;
● they provide a way of simplifying programs by making common
processes available to a wide number of programs;
● they lead to more reliable programs since once a process is
tested and works it can be made a subprocess and need not be
tested again.
In flowcharts subprocesses are also useful in sticking to the rule
that a flowchart should fit on a single page.

14
Basic elements of flowcharts

Figure 2.11 shows an example of the main page of a flowchart.


Start It contains two subprocess symbols. Each subprocess symbol
contains text which describes briefly what the subprocess does.
Each subprocess symbol also contains a page reference where the
Initialise flowchart for the subprocess will exist.
variables
1
Chapter review

Run In this chapter we built upon the last chapter to explore sequences in
calculation more detail and established how we can show these using flowcharts.
script
We looked at the basic elements of flowcharts and introduced the
2
concept of decisions and how these can be represented.
Remember, before tackling any computer science task or examination
question on this topic you must:
Print sum
➨ understand what an algorithm is and what algorithms are used for,
and be able to interpret algorithms in the form of flowcharts
➨ Understand and be able to explain and create algorithms to solve a
End particular problem, making use of programming constructs such as
sequence, selection and iteration
Figure 2.11 The subprocess ➨ understand and be able to use appropriate conventions in flowcharts
➨ understand and be able to explain the purpose of a given algorithm
and explain how it works
➨ understand and be able to explain and determine the correct output
of an algorithm for a given set of data.

15
3 Pseudo-code

   Specification references
You should:
1.1.1 understand what an algorithm is, what 2.1.2 understand the benefit of producing
algorithms are used for and be able to interpret programs that are easy to read and be able
algorithms (flowcharts, pseudo-code, written to use techniques (comments, descriptive
descriptions, program code) names (variables, constants, subprograms),
1.1.2 understand how to create an algorithm to indentation) to improve readability and to
solve a particular problem, making use of explain how the code works
programming constructs (sequence, selection, 2.2.1 understand the structural components of
iteration) and using appropriate conventions a program (variable and type declarations,
(flowchart, pseudo-code, written description, command sequences, selection, iteration, data
draft program code) structures, subprograms)
1.1.3 understand the purpose of a given algorithm 2.2.2 be able to use sequencing, selection and
and how an algorithm works iteration constructs in their programs
1.1.4 understand how to determine the correct 2.4.1 understand how to write code that accepts and
output of an algorithm for a given set of data responds appropriately to user input

Basic elements of pseudo-code


Pseudo-code is another way to develop an algorithm. It consists
of natural language-like statements that precisely describe the
steps required.
Pseudo-code must:
● contain statements which describe actions;
● focus on the logic of the algorithm or program;
  Key points ● avoid language-specific elements;

▲ Pseudo-code ● be written at a level so that the desired programming code can


is a language
designed to express algorithms be generated with little effort from each statement;
● contain steps, subordinate numbers and/or indentation used
in an easy to follow form.
▲ Pseudo-code is an easy to
to show dependent statements in selection and repetition
structures.
read language to help with
the development of coded Pseudo-code advantages
solutions.
● Pseudo-code is similar to everyday English.
▲ When writing in pseudo-code
● It helps programmers to plan an algorithm.
resist the urge to write in ● It can be done easily on a word processor.
whatever language you are ● It is easily modified.
most comfortable with. ● It implements structured concepts well.

16
The importance of syntax

Pseudo-code disadvantages
● Pseudo-code is not visual like flowcharts.
● There is no accepted standard, so it varies widely.
● It is not an actual programming language.
  Question ● It is an artificial and informal language.
● Some people have a tendency to put actual code in. This makes
1 What is pseudo-code?
it harder to understand.

The importance of syntax


Syntax is the set of rules, principles, and processes that enable us
to understand a language. The syntax rules of a language define
the spelling and grammar and as with natural human languages
each language has its own rules. Computers are very inflexible
and understand what you write only if you state what you want
in the exact syntax that the computer expects and understands.
Each programming language has its own rules and specialist
  Key point syntax including the words that the computer understands, which
For the examination you will need combinations of words are meaningful, and what punctuation is
to understand how to create necessary for the code to be correctly structured. Whilst pseudo-
an algorithm using appropriate code does not have a fixed syntax, you will need to understand
conventions (flowchart, pseudo- the syntax used in the examination papers. Understanding the
code, written description, draft importance of syntax is also vital when you start using a
program code). programming language.

Symbols
When we write code in English we also use symbols in the form of
punctuation. Symbols are used because they are human-readable.
The symbols you use are important as they have an effect in your
code.
these-words-are-seperated-by-a-symbol #the – is the symbol used
here
there is also a symbol in this sentence #here the space is the symbol
used
Symbols can also be used as what are called identifiers. In some
programming languages, they are also called atoms rather than
symbols.
The symbols ←, <<, <, –, and = are often used as what are called
  Key point
operators.
The symbols ←, <<, <, –, =
are often used to represent In pseudo-code, you use the following syntax to receive data from
the assignment operator in a device. The red brackets < > are only to show where you add
programming languages. something; you don’t need to put them in your code.
Syntax
RECEIVE <add identifier here> FROM (type) <add device here>

17
3 Pseudo-code

Examples
RECEIVE Name FROM (STRING) KEYBOARD
or
RECEIVE LengthOfJourney FROM (INTEGER) CARD_READER
or
RECEIVE YesNo FROM (CHARACTER) CARD_READER

Common action keywords


Several keywords are often used to indicate common input,
output, and processing operations.
● Input: READ, OBTAIN, GET
● Output: PRINT, DISPLAY, SHOW
● Process/compute: COMPUTE, CALCULATE, DETERMINE
● Initialise: SET, INIT
● Add one: INCREMENT

In pseudo-code, you use the following syntax to send output to


the screen. The red brackets < > are only to show where you add
something; you don’t need to put them in your code.

  Key point Syntax


SEND <add expression here> TO DISPLAY
For the examination, you will
need to be able to interpret Example
program code. SEND ‘Have a good day.’ TO DISPLAY

Whilst there is no common way of writing pseudo-code, in


this book we have written the commands in capital letters to
differentiate them from the examples in Python and to help you
understand what the command words are.
Questions in the Edexcel written examination that involve code
will use the following pseudo-code command words alongside
other words:
ELSE
END FOR
END IF
END WHILE
FOR
IF
INPUT
OUTPUT
REPEAT
RETURN
THEN
WHILE

18
Commenting on your code

Commenting on your code


Good code is not only well written, but should also be well
  Key point annotated. There are programmers who argue that comments
A comment is explanatory text for are not necessary if the code is written well, but you are
the human reader. undertaking an examination and it will be useful to explain what
your code does and why.
You will find many examples of commented code in this book.
Comments are shown using either // or #. Different programming
languages have different ways to tell the computer that this is a
comment NOT the code. You can make all the code you write in
pseudo-code a comment when you write the actual code using
  Key points your chosen language. This is considered good practice when
▲ Good code is well written and learning to code. You can also comment out bits of code to find
well annotated. errors, but we will explore this later.
▲ For the examination, you will
Questions in the Edexcel written examination that involve code
need to understand the benefit will use the following pseudo-code syntax for comments:
of producing programs that
are easy to read, and be able # some text
to use techniques (such as
comments, descriptive names Multiline comments will show the hash # for each separate
and indentation) to improve comment line.
readability and to explain how # some text
the code works.
# some more text on a new line
▲ For the examination, you will
need to understand how to Comments remind you and the examiner why you included
create an algorithm making certain functions. They also make maintenance easier for you
use of programming constructs later.
such as sequence, selection
and iteration. Have you ever tried to work with someone else’s complex
spreadsheet or database? It’s not easy. Now imagine how difficult
it is if you’re looking at someone else’s programming code.
  Question
When you fully document your code with comment tags, you’re
2 What is a comment? answering (at least) three questions:
● Where is it?
● Why did I do that?
  Task ● What does this code do?

1 Describe the main reasons No matter how simple, concise, and clear your code may end up
why a programmer would wish being, it’s impossible for code to be completely self-documenting.
to annotate or add comments Even with very good code it can only tell the viewer how the
to their code. program works; comments can also say why it works.

Adding selection
As we discovered in the last chapter on flowcharts, another
important aspect of programming is selection. If we want to
write pseudo-code that tells a user to enter a number to a variable,

19
3 Pseudo-code

and then we want the code to see if the number they entered is a 3
or a 4 we could write a selection algorithm in pseudo-code that
could look like this:
RECIEVE inputNumber FROM (int) KEYBOARD #Input
IF inputNumber = 3 #Selection (Process)
SEND “your number is 3” TO DISPLAY #Output
ELSE IF inputNumber = 4
SEND “your number is 4” TO DISPLAY
ELSE
SEND “your number is not 3 or 4” TO DISPLAY
END IF

We could also write the code a different way:


RECIEVE inputNumber FROM (int) KEYBOARD
  Key points
IF inputNumber = 3
▲ The IF statement is used to
THEN SEND “Your number is a 3” TO DISPLAY
create a decision structure,
which allows a program to ELSE IF inputNumber = 4
have more than one path of THEN SEND “Your number is a 4” TO DISPLAY
execution. ELSE SEND “Your number is not a 3 or a 4” TO DISPLAY
▲ The IF statement causes END IF
one or more statements to
execute only when a Boolean
expression is true.
  Task
▲ An IF-ELSE statement 2 Use this book and other sources such as the Internet to research how
will execute one block of to identify and correct errors in algorithms.
statements if its condition is 3 Use this book and other sources such as the Internet to research how
true, or another block if its standard algorithms (bubble sort, merge sort, linear search, binary
condition is false. search) work.

20
Commenting on your code

Chapter review
In this chapter we have explored pseudo-code and ➨ understand how to determine the correct output of
how to use it to show program flow and decision an algorithm for a given set of data
making.
➨ understand and be able to use appropriate
We also explored the importance of syntax and how to conventions in pseudo-code
comment on your code.
Remember, before tackling any computer science task
➨ understand and be able to explain the benefit of
producing programs that are easy to read and be
or examination question on this topic you must: able to use techniques such as comments and
➨ understand and be able to explain what algorithms descriptive names for variables, constants, and
are used for subprograms alongside indentation to improve
readability and to explain how the code works
➨ be able to interpret and write algorithms in pseudo-
code ➨ be able to use sequencing, selection and iteration
constructs in your programs
➨ understand and be able to explain and create
algorithms to solve a particular problem, making ➨ understand and be able to apply structural
use of programming constructs (such as sequence, components of a program including variable and
selection, iteration) type declarations and sequences, selection,
iteration, data structures, and subprograms.
➨ understand and be able to explain and apply the
purpose of a given algorithm and how an algorithm
works

21
Summary of features

2 Using flowcharts
Each chapter clearly references
the understanding and skills
students will need to practise
and exhibit in their exams
Specification references iteration) and using appropriate conventions
You should:
1.1.1 understand what an algorithm is, what draft program code)
algorithms are used for and be able to interpret 1.1.3 understand the purpose of a given algorithm
and how an algorithm works
descriptions, program code) 1.1.4 understand how to determine the correct
1.1.2
Key points clarify understand how to create an algorithm to
significant output of an algorithm for a given set of data
information for students toa particular problem, making use of
solve 2.4.1 understand how to write code that accepts and
be able to process and programming
recall constructs (sequence, selection, responds appropriately to user input
easily

Key points There are a lot of different design procedures and techniques for
building large software projects. The technique discussed in this
▲ A is a diagram chapter, however, is for smaller coding projects and is referred to
representation of an algorithm. by the term ‘top down, structured flowchart methodology’. We
▲ For the examination, you will will explore how to take a task and represent it using a flowchart.
need to be able to interpret A flowchart puts the sentences from a sequence into shaped
boxes. The shapes indicate the action.
▲ Flowcharts are a graphical You will know from the last chapter that a sequence is where a set
method of designing of instructions or actions are ordered, meaning that each action
programs. follows the previous action.

to read.
Key terms will help students
develop computing language
skills to facilitate greater
subject understanding

Key term
For the examination, you will
need to be able to interpret

Key point

the order of execution. Figure 2.1 A sequence

22
Edexcel Computer Science for GCSE

General rules for flowcharts

General rules for flowcharts


● All symbols of the flowchart are connected by flow lines
Key points (these must be arrows not lines to show direction).
▲ ● Flow lines enter the top of the symbol and exit out the bottom,
lines with arrows to show the except for the Decision symbol, which can have flow lines
order of execution. exiting from the bottom or the sides.
▲ An algorithm is a sequence of ● Flowcharts are drawn so flow generally goes from the top to
steps that can be followed to the bottom of the page.
complete a task. ● The beginning and the end of the flowchart is indicated using
▲ A sequence is where a set the Terminal symbol.
of instructions or actions are Let’s look at a simple sequence. Say we want to calculate A plus B,
ordered, meaning that each where A = 200 and B = 400.
action follows the previous
action. Start
Practice tasks will
A = 200 B = 400 Start
help build students’
coding, programming Add = 200 + 400
and problem-solving Output = 600
skills End
Action 1
Let's look at a another sequence,
Task for example the sequence you carry
1 Produce a sequence to show out each morning in the bathroom.
how to brush your teeth. This sequence could be: End
● Brush teeth
● Wash face Figure 2.2
● Comb hair.
Practice questions will Each chapter concludes with
help build students’
As you can see, sequences are a useful tool for showinga reviewwhat
of key information
coding, programming
happens and in what logical order, but each step, to forassess
example
and consolidate
and problem-solving
‘brush teeth’, needs to be defined in more detail to betopic
carried out.
knowledge and
skills understanding

Questions Chapter review


1 What is a Terminator?
In this chapter we built upon the last chapter to explore sequences in
2 What is a Sequence? more detail and established how we can show these using flowcharts.
3 What is an Input/Output? We looked at the basic elements of flowcharts and introduced the
concept of decisions and how these can be represented.
Remember, before tackling any computer science task or examination
question on this topic you must:
➨ understand what an algorithm is and what algorithms are used for,
and be able to interpret algorithms in the form of flowcharts
➨ use a systematic approach to problem solving and algorithm creation
representing those algorithms using flowcharts;
➨ understand and be able to use appropriate conventions in flowcharts

23
EdExcEl GcSE computEr SciEncE StudEnt Book
These sample chapters are taken from the forthcoming Edexcel GcSE computer Science Student Book.
Build student confidence and ensure successful progress through GCSE Computer Science. Our
expert author provides insight and guidance for students to meet the demands of the new Edexcel
specification, with challenging tasks and activities to test the computational skills and knowledge
required for success in the assessment, and advice for successful completion of the non-examined First teaching
assessment. from September
■■ Builds students’ knowledge and confidence through detailed topic coverage and explanation of 2016
key terms.
■■ Develops computational thinking skills with practice exercises and problem-solving tasks.
■■ Instils a deeper understanding and awareness of computer science, and its applications and
implications in the wider world.
■■ Helps monitor progression through GCSE with regular assessment questions, that can be further developed
with supporting Dynamic Learning digital resources.
Author:
Steve Cushing is a well-respected and widely published author for secondary Computing, with examining
experience.

Textbook subject to change based on endorsement review.


Visit www.hoddereducation.co.uk/ComputerScience/GCSE/Edexcel to pre order your class sets or
to sign up for Inspection Copies or eInspection Copies.

ALSO AVAILABLE

Dynamic Learning
Edexcel GCSE Computer Science Dynamic Learning is an online
subscription solution that supports teachers and students with high
quality content and unique tools. Dynamic Learning incorporates
Teaching and Learning resources, Whiteboard and Student eTextbook elements
that all work together to give you the ultimate classroom and homework resource.

Sign up for a free trial – visit: www.hoddereducation.co.uk/dynamiclearning

You might also like