Paper 2 Computer Science IGCSE Notes
Paper 2 Computer Science IGCSE Notes
Paper 2
Exam Technique
Know what the examiners can ask you questions about
Have a look at the IGCSE Computer Science syllabus that you have been studying and are going
to be taking the exam for. The list of topics will make a great checklist for your revision. If you
find something that you don’t understand or haven’t made any notes about, then find out about
it. A
nything that is mentioned in the syllabus could be used in an examination question.
Read and understand examination questions
What are you being asked to do?
1. Read the question x3
2. Understand the type of instruction you are being given: Complete, Describe, Draw, Explain,
Give and State all require different actions.
3. If the question makes use of a specific scenario or context then make sure that all of your
answers are relevant to that context. For example, if the question is about security
measures for an offline device, then using an internet-based firewall would not be
appropriate!
4. Decide on the information required but remember that you are sitting an iGCSE
examination and most answers will require more than just a single word. If you have
finished well before the time allotted, you may well have fallen into this trap.
5. Always use correct technical terms and avoid the use of trade names. For example, talk
about the use of an operating system rather than the use of ‘Windows 10’.
6. Decide how much information is required to fulfil the number of marks available and if in
doubt, add more!
Help the examiner help you!
- Make sure your answers are easy to read (if in doubt, write it again, clearer!).
- Read through the entire question before you start to answer it, give yourself thinking time
and decide how you will format your answer before writing.
- Make it easy for the examiner to see where he/she should give you the marks. This also
helps you make sure that you will gain every mark available.
- Answer every question! There is no point leaving blank spaces, you will not lose marks for
incorrect answers, so you may as well have a guess.
- You have plenty of time in the exam. Use the first 5 minutes to read through the paper.
Maybe attempt some of the easier questions first to ease you into the problem-solving
frame of mind before tackling the harder ones.
2.1 - Algorithm design and problem-solving
2.1.1 Problem solving and design
a) show understanding that every computer system is made up of sub-systems, which in
turn are made up of further sub-systems
Breaking down a problem into many smaller problems is called decomposition and is one of the
cornerstones of computational thinking.
b) use top-down design, structure diagrams, flowcharts, pseudocode, library routines
and subroutines
Top-down design is the process of
decomposing a system into smaller parts until
each sub-system performs just one task. This
can be shown in a structure diagram like the
one on the right.
Flowcharts and pseudocode are ways of
writing a solution to a problem (see 2.1.2).
Subroutines are blocks of code written by the
programmer that are designed to perform a
frequently used operation within a program.
They can be called back as many times as
necessary at any point in the program.
Library routines are blocks of pre-written code
that are stored in a program library. They can be called into other programs when necessary.
c) work out the purpose of a given algorithm
Algorithms are represented in either pseudocode or as a flowchart. You should pay close
attention to any mathematical operators and loops in order to work out the purpose of an
algorithm. It may have a real-world purpose related to context given a question (e.g. input all the
sales for one week in a shop and output the maximum, the minimum and the average sale), or
simply a theoretical/mathematical function (e.g. input a list of 50 numbers and output the
number of even numbers in the list).
d) explain standard methods of solution
You should be able to identify different types of loops (count-controlled/condition controlled),
describe comparison operators from their symbol (<, >, != etc). You should also be able to identify
why a specific type of loop is most applicable to a solution and which comparison operator to
use and why.
e) suggest and apply suitable test data
Normal data - Solutions need to be tested to prove that they do what they are supposed to do.
Normal data is data that the system should expect to routinely receive and should not expect to
cause any errors.
Erroneous/abnormal data - Solutions also need to be tested to prove that they do not do what
they are not supposed to do. Test data should be used that will be rejected as the values are not
suitable (e.g. the wrong data type).
Extreme data - When testing algorithms with numerical values, sometimes only a given range of
values should be allowed. Extreme data are the largest and smallest values that normal data can
take. Extreme data should be accepted.
Boundary data - Boundaries should be tested in an algorithm before an algorithm is approved.
At each boundary, two values are required (one either side of the boundary), one value is
accepted and the other value is rejected.
f) understand the need for validation and verification checks to be made on input data
(validation could include range checks, length checks, type checks and check digits)
Validation - is the automated checking by a program that data is reasonable before it is
accepted into a computer system. Different types of check may be used on the same piece of
data.
Verification is checking that data has been accurately copied onto the computer or transferred
from one part of a computer system to another.
Validation Verification
ENDIF
CASE statements allow one out of several branches of code to be executed, depending on the
value of a variable.
CASE statements are written as follows. The OTHERWISE statement is optional.:
CASE OF <identifier>
<value 1> : <statement>
<value 2> : <statement>
...
OTHERWISE <statement>
ENDCASE
Example:
INPUT Move
CASE OF Move
‘W’ : YPosition ← YPosition + 10
‘S’ : YPosition ← YPosition - 10
‘A’ : XPosition ← XPosition - 10
‘S’ : XPosition ← XPosition + 10
OTHERWISE : OUTPUT "Error"
ENDCASE
c) understand and use pseudocode, using the following loop structures: FOR … TO … NEXT
REPEAT … UNTIL WHILE … DO … ENDWHILE
Count-controlled loops are written as follows:
FOR <identifier> ← <value1> TO <value2>
<statements>
NEXT <identifier>
Identifiers must be of type integer and the values can be other identifiers that can evaluate to
integers.
Condition-controlled loops are either a REPEAT...UNTIL or a WHILE...DO loop. The difference is
that in a REPEAT loop the condition is evaluated at the end (meaning the programming
statements must run at least once). In a WHILE loop, the condition is evaluated at the start,
meaning that the programming statements do not have to run at all (if the condition is never
met).
A REPEAT loop is written as follows:
REPEAT
<statements>
UNTIL <condition>
2.2 Programming
2.2.1 Programming concepts
a) declare and use variables and constants
A variable is an identifier that can store a value of a basic data type, this value can be
reassigned at any time. A constant can also store a value of a basic data type, but it cannot be
reassigned.
b) understand and use basic data types: Integer, Real, Char, String and Boolean
An Integer is a whole number, positive or negative. E.g. 1, 10, 17, -1, -100 etc.
A Real is number capable of containing a fractional part. E.g. 3.14, 10.00, 10.6, 7.45673 etc.
A Char is a single character. E.g. "A", "T", "f", "7", "?", "%" etc.
A String is a sequence of zero or more characters. E.g. "Computing", "Where?", "", "One
Million"etc.
A Boolean value is either True or False. E.g. "True" or "False".
c) understand and use the concepts of sequence, selection, repetition, totalling and
counting
Sequence is simply processing instructions in the correct logical order.
Selection is where the program has to make a decision about what to output or do next. E.g. an if
or case statements
Repetition or Iteration is the process of repeating some lines of code or looping. Loops can be
either count-controlled or condition controlled.
A FOR loop is count-controlled, and a WHILE...DO or a REPEAT...UNTIL loop are both condition
controlled.
d) use predefined procedures/functions
A procedure or function is a defined section of code that is able to be called back anywhere in a
program. A procedure carries out a series of instructions and a function carries out instructions
but also returns a value.
2.2.2 Data structures; arrays
It is important to note that each element in the array is identified by its index number, which
always starts at 0 in pseudocode unless stated otherwise.
a) declare and use one-dimensional arrays, for example: A[1:n]
We can create an array with blank values like this:
FiveNames ← ["", "", "", "", ""]
FiveIntegers ← [0,0,0,0,0]
2.3 Databases
A Table contains data about one type of item or person or event, using rows and columns. There
are a set number of columns and a variable number of rows for each table.
A Record is each row within a table. A row contains data about a single item, person or event.
A Field is each column within the table. One field is one specific piece of information about a
single item. Fields are given a data type.
A Primary Key is a unique field in a table. It must be uniques so every value in the table should be
different. This is usually an ID number or something similar, to make sure that each record is
unique.
a) define a single-table database from given data storage requirements
You should be able to identify the fields needed and the data type for each field give the
requirements presented in the question. You may also be asked to identify suitable validation
methods to use e.g. length check, presence check, format check etc.
b) choose and specify suitable data types
Data types in databases are different from data types in programming:
Programming Data Type Database Data Type
Integer Number
String Text
Boolean Yes/No
Date/Time Date/Time
*Doesn’t exist in all programming languages*
c) choose a suitable primary key for a database table
A Primary Key is a unique field in a table. It must be uniques so every value in the table should be
different. This is usually an ID number or something similar, to make sure that each record is
unique.
d) perform a query-by-example from given search criteria.
A query by example grid consists of a table with 5 or 6 rows. Each row requires filling in to
complete the query.
Field - The name of field required in the query.
Table - The name of the table that the field is located in (for iGCSE questions this is almost
always the same table for every field).
Sort - Ascending or Descending or leave blank. Does the data need sorting by this field after the
query has taken place?
Show - Tick box, does this field need to be shown in the results or can it be hidden. Usually
obvious from the question
Criteria - Usually obvious from the question. Use a comparator such as =, < or > in order to filter
the results. For example: "> 50" would only return the records in which the value of this field is
greater than 50.