Edexcel Computer Science SAMPLE PAGES
Edexcel Computer Science SAMPLE PAGES
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:
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
6
Section four: Computers
26 The computer systems architecture
27 Memory
28 Secondary storage
29 Cloud computing
30 Fetch-Decode-Execute cycle
31 Software
7
2 Using flowcharts
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.
9
2 Using flowcharts
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’.
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
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
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
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
End
12
Basic elements of flowcharts
Landed Yes
Slide down
on snake tail of snake
Throw dice head?
No
No
Output ‘You are
No the winner’
Reached
last square of
game?
Yes End
13
2 Using flowcharts
Subprocesses
We can also use subprocesses in flowcharts using the symbol
below.
Subprocess
14
Basic elements of flowcharts
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
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.
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
18
Commenting on your code
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
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
22
Edexcel Computer Science for GCSE
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.
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.