CAMBRIDGE IGCSE COMPUTER
SCIENCE PAPER 2 EXAM Q&A
Sequence (flowchart) - Answer-A code construct that flows in order
Selection (flowchart) - Answer-A code construct that makes a choice
Iteration (flowchart) - Answer-A code construct that loops.
Pseudocode - Answer-'Mock' or 'pretend' code - a way of describing an algorithm you
are intending to code without using a specific programming language
ENDIF - Answer-Pseudocode statement that ends an "if" block (we don't need it in
Python but we MUST remember it in pseudocode)
NEXT (counter variable) - Answer-Pseudocode:
A FOR loop must be ended with this
Sequence - Answer-When instructions are executed one after another, e.g.:
INPUT x
y <- x+1
OUTPUT y
Selection - Answer-When a decision is made regarding which instructions get executed
next e.g.
IF mark >= 50
OUTPUT "pass"
ELSE
OUTPUT "fail"
ENDIF
increment - Answer-to make bigger, particularly to make bigger by one
e.g.
i=i+1
or
i += 1
decrement - Answer-to make smaller, particularly to make smaller by one
e.g.
i=i-1
or
i -= 1
, Accumulator Variable - Answer-a variable which we add to eg. as we loop through a list
to compute a total or average
It should usually be initialised to zero before we start adding to it
Iteration (repetition) - Answer-When a block of instructions is executed repeatedly e.g
FOR i = 1 *TO* 10
sum <- sum + i
NEXT i
Self-documenting code - Answer-When code is developed in a way that makes it easy
for another programmer to understand. This can include suitable naming of data
structures and subroutines, and code comments.
All code should be written this way
Type declaration - Answer-When a variable is allocated a particular data type (integer,
string, Boolean, float).
Source Code - Answer-The code written by the programmer before it is translated in to
machine code.
Suitable Naming Conventions - Answer-When subroutines and data structures are
given a name which represents what they do or store.
Indentation - Answer-Positioning a block of code, e.g. a for loop or an if statement,
further from the margin than the main program. The use of indentation makes programs
easier to read.
In Python correct indentation is important, since indenting starts a block and unindenting
ends it.
In Pseudocode it's only important for readibility
Comment - Answer-Text included in code that is for the human reader and is ignored by
the program.
In Python, they are indicated by the # symbol at the start of a line.
In pseudocode they start with //
Subroutine (subprogram) - Answer-A self-contained block of code or small computer
program that runs within another larger computer program.
These split up a program into a number of units, each performing a specific function.
SCIENCE PAPER 2 EXAM Q&A
Sequence (flowchart) - Answer-A code construct that flows in order
Selection (flowchart) - Answer-A code construct that makes a choice
Iteration (flowchart) - Answer-A code construct that loops.
Pseudocode - Answer-'Mock' or 'pretend' code - a way of describing an algorithm you
are intending to code without using a specific programming language
ENDIF - Answer-Pseudocode statement that ends an "if" block (we don't need it in
Python but we MUST remember it in pseudocode)
NEXT (counter variable) - Answer-Pseudocode:
A FOR loop must be ended with this
Sequence - Answer-When instructions are executed one after another, e.g.:
INPUT x
y <- x+1
OUTPUT y
Selection - Answer-When a decision is made regarding which instructions get executed
next e.g.
IF mark >= 50
OUTPUT "pass"
ELSE
OUTPUT "fail"
ENDIF
increment - Answer-to make bigger, particularly to make bigger by one
e.g.
i=i+1
or
i += 1
decrement - Answer-to make smaller, particularly to make smaller by one
e.g.
i=i-1
or
i -= 1
, Accumulator Variable - Answer-a variable which we add to eg. as we loop through a list
to compute a total or average
It should usually be initialised to zero before we start adding to it
Iteration (repetition) - Answer-When a block of instructions is executed repeatedly e.g
FOR i = 1 *TO* 10
sum <- sum + i
NEXT i
Self-documenting code - Answer-When code is developed in a way that makes it easy
for another programmer to understand. This can include suitable naming of data
structures and subroutines, and code comments.
All code should be written this way
Type declaration - Answer-When a variable is allocated a particular data type (integer,
string, Boolean, float).
Source Code - Answer-The code written by the programmer before it is translated in to
machine code.
Suitable Naming Conventions - Answer-When subroutines and data structures are
given a name which represents what they do or store.
Indentation - Answer-Positioning a block of code, e.g. a for loop or an if statement,
further from the margin than the main program. The use of indentation makes programs
easier to read.
In Python correct indentation is important, since indenting starts a block and unindenting
ends it.
In Pseudocode it's only important for readibility
Comment - Answer-Text included in code that is for the human reader and is ignored by
the program.
In Python, they are indicated by the # symbol at the start of a line.
In pseudocode they start with //
Subroutine (subprogram) - Answer-A self-contained block of code or small computer
program that runs within another larger computer program.
These split up a program into a number of units, each performing a specific function.