OL CS P2 Notes Booklet
OL CS P2 Notes Booklet
● Analysis
● Design
● Coding
● Testing
● Maintenance
Analysis
● Before solving a problem, it is essential to define and document the problem clearly, known as
the "requirements specification" for the program.
● The analysis stage involves using tools like abstraction and decomposition to identify the specific
requirements for the program.
● Abstraction focuses on the essential elements needed for the solution while eliminating
unnecessary details and information.
● Decomposition involves identifying components parts of input, process, output, and storage.
The complex problem is then broken into smaller, more manageable parts that can be solved
individually.
Design
● The program specification derived from the analysis stage is used as a guide for program
development.
● During the design stage, the programmer should clearly understand the tasks to be completed, the
methods for performing each task, and how the tasks will work together.
● Documentation methods such as structure charts, flowcharts, and pseudocode can be used to
document the program's design formally.
CSwithAwab.com 1 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
Testing
● The completed program or set of programs is executed multiple times using various test data
sets.
● This testing process ensures that all the tasks within the program work together as specified in
the program design.
● Running the program with different test data can identify and address potential issues and errors.
● The testing phase aims to verify the overall functionality and performance of the program by
evaluating its behavior with various inputs.
● Every computer system is made up of sub-systems, which are in turn made up of further sub-
systems.
● Structure Diagrams - The breaking down of a computer system into sub-systems, then breaking
each sub-system into smaller sub-systems until each one only performs a single action. A
structure diagram diagrammatically represents a top-down design.
CSwithAwab.com 2 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
Test Data
● Test data refers to input values used to evaluate and assess the functionality and performance of a
computer program or system.
● It helps identify errors and assess how the program handles different scenarios
Normal Data
● Normal data is the test data which accepts values in an acceptable range of values of the
program
● Normal data should be used to work through the solution to find the actual result(s) and see if they
are the same as the expected result(s)
● e.g. in a program where only whole number values ranging from 0 to 100 (inclusive) are
accepted, normal test data will be: 23, 54, 64 , 2 and 100
Abnormal Data
● Test data that would be rejected by the solution as not suitable, if the solution is working
properly is called abnormal test data / erroneous test data.
● e.g. in a program where only whole number values ranging from 0 to 100 (inclusive) are
accepted, abnormal data will be: -1, 151, 200, 67.2, “Sixty-Two” and -520
Extreme Data
● Extreme data are the largest and smallest values that normal data can take
● e.g. in a program where only whole number values ranging from 0 to 100 (inclusive) are
accepted, extreme data will be: 0 and 100
Boundary Data
● This is used to establish where the largest and smallest values occur
● At each boundary two values are required: largest accepted & smallest rejected // smallest
accepted & largest rejected
Trace Table
● A trace table is utilized to document the outcomes of every step in an algorithm. It is
employed to record the variable's value each time it undergoes a change.
● A dry run refers to the manual process of systematically executing an algorithm by following
each step in sequence.
● A trace table is set up with a column for each variable and a column for any output e.g.
CSwithAwab.com 3 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
Validation
Validation in computer systems involves automated checks to ensure the reasonableness of data before
accepting it. If the data is invalid, the system should provide an explanatory message for rejection and allow
another chance to enter the data.
Range check
A range check verifies that a numerical value falls within specified upper and lower limits.
Length check
This can either ensure that data consists of a precise number of characters.
Type Check
A type check verifies that the entered data corresponds to a specific data type.
Presence Check
A presence check to ensure that some data has been entered and the value has not been left blank.
Format Check
A format check checks that the characters entered conform to a pre-defined pattern.
Check Digit
● A check digit is the final digit included in a code; it is calculated from all the other digits.
● Check digits are used for barcodes, product codes, International Standard Book Numbers
(ISBN), and Vehicle Identification Numbers (VIN).
CSwithAwab.com 4 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
Verification
Verification is checking that data has been accurately copied from one medium to another
1. Double Entry
2. Screen/Visual check
● A screen/visual check involves the user manually reviewing the entered data.
● After data entry, the system displays the data on the screen and prompts the user to confirm its
accuracy before proceeding.
● The user can compare the displayed data against a paper document used as an input form or rely
on their own knowledge to verify correctness.
● always use meaningful identifier names for variables, constants, arrays, procedures and
functions
● be divided into modules for each task using procedures and functions
● be fully commented using your programming language’s commenting feature
Commenting in pseudocode:
# Or \\ Now the text written is commented and thus ignore
CSwithAwab.com 5 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
Programming Concepts
When writing the steps required to solve a problem, the following concepts need to be used and
understood:
● Sequence
● Selection
● Iteration
● Counting and totaling
● String handling
● Use of operators.
Sequence
The ordering of the steps in an algorithm is very important. An incorrect order can lead to incorrect results
and/or extra steps that are not required by the task.
Selection
It allows different routes through the steps of a program. Example: If conditions, Case of otherwise
Iteration
Repeating a block of code multiple times. Example: For, while, repeat until loops
• Count-controlled: For loop
o Runs for a fixed number of times
o Count of iterations is already known
CSwithAwab.com 6 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 7 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 8 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 9 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 10 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 11 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 12 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 13 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 14 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 15 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 16 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 17 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 18 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 19 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 20 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 21 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 22 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
Databases
A database is a well-organized compilation of data that enables individuals to retrieve
information according to their specific requirements. The data contained within a database can
encompass various forms such as text, numerical values, images, or any other type of digital
content that can be stored on a computer system.
Primary Key
CSwithAwab.com 23 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
Foreign Key
● A field in one table that refers to the primary key in another table. It creates a relationship
between the two tables, ensuring data consistency by enforcing referential integrity
SQL Scripts
● An SQL script is a collection of SQL commands that are used to perform a specific task, often
stored in a file for reusability.
● To comprehend SQL and interpret the output of an SQL script, practical experience in writing SQL
scripts is necessary.
Select Statements:
SELECT (fieldname)
FROM (tablesname)
WHERE (condition)
ORDER BY (sortingcondition) ;
CSwithAwab.com 24 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 25 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
CSwithAwab.com 26 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
-if the logic circuit/network has only 2 inputs then the truth table for them is:
-total combinations are 22=4
A B
0 0
0 1
1 0
1 1
-if the logic circuit/network has only 3 inputs then the truth table for them is:
-total combinations are 23=8
A B C
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
CSwithAwab.com 27 cswithawab
OL/IGCSE CS (2210/0478) Paper 2 Notes by Awab Aqib
A B C
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
-Assuming the above Truth table, we will only consider the outputs that are 1
-Each input with 0 value will be replaced by NOT and 1 will be replaced by input symbol
CSwithAwab.com 28 cswithawab