Professional Documents
Culture Documents
Cambridge IGCSE Computer Science Paper 2 Programming Notes (2023-2025)
Cambridge IGCSE Computer Science Paper 2 Programming Notes (2023-2025)
Cambridge IGCSE Computer Science Paper 2 Programming Notes (2023-2025)
Abstraction – a method used in the analysis stage of the program development life cycle;
the key elements required for the solution to the problem are kept and any unnecessary
details and information that are not required are discarded.
Design: uses the program specification from the analysis stage to show to how the program should
be developed
Decomposition – a complex problem is broken down into smaller parts, which can then be
sub divided into even smaller parts that can be solved more easily.
Decomposing a problem
Inputs – the data used by the system that needs to be entered while the system is active.
Processes – the tasks that need to be performed using the input data and any other
previously stored data.
Outputs – information that needs to be displayed or printed for the users of the system.
Storage – data that needs to be stored in files on an appropriate medium for use in the
future.
Testing: systematic checks done on a program to make sure that it works under all conditions
Sub-systems
– Flowcharts: A diagram that shows the steps required for a task (sub-system) and the order in which
the steps are to be performed. A graphical representation used to represent an algorithm.
1
Top-Down Design
The breaking down of a computer system into a set of sub-systems, then breaking each subsystem
down into a set of smaller sub-systems, until each sub-system just performs a single action.
▪ Breaking a problem down into smaller parts/tasks make it far easier to understand, solve and
manage.
▪ Top-down design allows several programmers or teams to work on the same project, without
getting in each other’s way.
▪ Each module of code to be tested separately.
Variable: A variable is a storage location. It is a named value that contains data that can be changed
throughout the execution. E.g: Total
Constant: A constant is also a storage location. It is a named location that contains a value that we
don’t want to change during the running of the program. E.g: CONSTpi 3.142
Array: An array is a data structure containing several elements of the same data type and stored under
a single name. To reduce the number of variables used. Any item can be found using an index number.
Data Type
Boolean: A data type with two possible values. E.g: True / False
Real: A positive or negative number with a fractional part. E.g: 23.05 / - 24.56
▪ Sequence is the concept of one statement being executed after another whereas selection
decides which statements are to be executed depending upon the result of a question.
Sequence:
PRINT X
PRINT Y
2
Selection
Conditional Statement
▪ IF …. THEN …. ELSE
LOOPING
FOR …. TO …. NEXT
Fixed number of repetitions. A loop that will always iterate a set number of times.
REPEAT …. UNTIL
Always executed post condition test. The loop is continued when the criteria has been met. A
loop that will always iterate at least once.
WHILE …. DO …. ENDWHILE
Pre-condition test that means condition is placed at the start of the loop. The loop is continued
when the criteria have not been met.
Iteration
Subroutine is sub program, it is not the whole program to perform a frequently used operation with a
program. That can be called when needed and reused by another program. Eg: Procedure and Function
A procedure is a set of programming statements grouped together under a single name that can be
called to perform a task at any point in a program.
A function is a set of programming statements grouped together under a single name that can be
called to perform a task at any point in a program. In contrast to a procedure, a function will return a
value back to the main program.
Parameters are the variables that store the values of the arguments passed to a procedure or function.
Some but not all procedures and functions will have parameters.
3
Counting is used with repetition with the counter increased by 1 every time the loopis repeated.
Count Count + 1
Totalling is used with repetition with the total updated every time the loop is repeated.
A global variable can be used by any part of a program – its scope covers the whole program.
A local variable can only be used by the part of the program it has been declared in – its scope is
restricted to that part of the program.
Errors
Syntax Error
▪ Syntax Error occurs when a programmer does not follow the rules or structure of the language
they are writing in.
Logic Error
▪ A logic error is an error in the code that causes the program to do something it should not.
Validation – Automated checks carried out by a program that data is reasonable before it is accepted
into a computer system.
Validation is an automatic check to ensure that data entered is sensible and feasible.
Range check – a check that the value of a number is between an upper value and a lower value.
Length check – a method used to check that the data entered is a specific number of characters
long or that the number of characters is between an upper value and a lower value.
Format check – a check that the characters entered conform to a pre-defined pattern.
Check digit – an additional digit appended to a number to check if the entered number is error-
free; check digit is a data entry check and not a data transmission check.
Verification – checking that data has been accurately copied from another source and input into a
computer or transferred from one part of a computer system to another. Verification is
a way of preventing errors when data is copied from one medium to another.
4
Double Entry: Data is entered twice and the computer checks that they match up.
Re enter password:
Visual check: The user manually reads and compares the newly inputted data against the original
source to ensure they match.
Set of test data – all the items of data required to work through a solution.
Boundary data – the largest/smallest data value that is accepted by a program and the corresponding
smallest/largest rejected data value.
Linear search – an algorithm that inspects each item in a list in turn to see if the item matches the
value searched for.
Bubble sort – an algorithm that makes multiple passes through a list comparing each element with
the next element and swapping them. This continues until there is a pass where no more swaps are
made.
Library routines: Library routines that are ready to incorporate into a program.
5
ARRAY
▪ Data stored in RAM will be lost when the computer is switched off, when data is saved to a file
it is stored permanently.
▪ Data stored in a file can thus be accessed by the same program at a later date or accessed by
another program.
▪ Data stored in a file can also be sent to be used on other computer(s).
▪ The storage of data in files is one of the most used features of programming.
▪ Data can be backed up or archived.
– meaningful identifiers
– variables
– constants
– arrays