CS-practical Notes (For A SATAR)
CS-practical Notes (For A SATAR)
ORG
CAIE IGCSE
COMPUTER
SCIENCE
SUMMARIZED NOTES ON THE PRACTICAL SYLLABUS
Prepared for Ahmad Usaid for personal use only.
CAIE IGCSE COMPUTER SCIENCE
Testing
1. Algorithm Design & The completed program or set of programs is executed
multiple times using various test data sets.
Problem-Solving This testing process ensures that all the tasks within the
program work together as specified in the program
1.1. Program Development Life Cycle design.
Running the program with different test data can identify
(PDLC) and address potential issues and errors.
The testing phase aims to verify the overall functionality
Analysis and performance of the program by evaluating its
Design behaviour with various inputs.
Coding
Testing
Maintenance
1.2. Structure Diagrams
Every computer system is made up of sub-systems, which
Analysis
are in turn made up of further sub-systems.
Structure Diagrams – The breaking down of a computer
Before solving a problem, it is essential to define and
document the problem clearly, known as the system into sub-systems, then breaking each sub-system
into smaller sub-systems until each one only performs a
"requirements specification" for the program.
single action. A structure diagram diagrammatically
The analysis stage involves using tools like abstraction
represents a top-down design. Example below.
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 breaking down complex problems
into smaller, more manageable parts that can be solved
individually.
Daily tasks can be decomposed into constituent parts for
easier understanding and solving. 1.3. Pseudocode & Flowcharts
Design Pseudocode - Verbal representation of an algorithm (a
process or set of steps) and flowcharts are a
The program specification derived from the analysis diagrammatic representation.
stage is used as a guide for program development. Flowcharts: A flowchart shows diagrammatically the steps
During the design stage, the programmer should clearly required to complete a task and the order that they are to
understand the tasks to be completed, the methods for be performed
performing each task, and how the tasks will work Algorithm: These steps, together with the order, are
together. called an algorithm
Documentation methods such as structure charts,
flowcharts, and pseudocode can be used to document the
program's design formally.
WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Ahmad Usaid at Pakistan Internal School Jeddah , Cambridge Curriculum System on 17/05/24.
CAIE IGCSE COMPUTER SCIENCE
INPUT Name
OUTPUT "Hello Mr." , Name
// Alternatively //
READ Name
PRINT "Hello Mr," , Name
An example of a flowchart is given below from a past paper Array: Array is similar to variable but it can store multiple
question in which all of the functions of a flowchart are values of same datatype under single name
shown:
DECLARE [ARRAYNAME] : ARRAY [Lower Limit : Upper Limit
Conditional Statements:
IF…THEN…ELSE…ENDIF
WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Ahmad Usaid at Pakistan Internal School Jeddah , Cambridge Curriculum System on 17/05/24.
CAIE IGCSE COMPUTER SCIENCE
corresponding consequences \n
// Average//
IF ((CONDITION 1) OR ( CONDITION 2)) AND (CONDITION 3) AND (CONDITION 4)
THEN
OUTCOME Total ← 0
ELSE FOR Counter ← 1 TO NumberOfValues
OUTCOME Total ← Total + StudentMark[Counter]
ENDIF
WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Ahmad Usaid at Pakistan Internal School Jeddah , Cambridge Curriculum System on 17/05/24.
CAIE IGCSE COMPUTER SCIENCE
Range check
INPUT Value
Found ← FALSE A range check verifies that a numerical value falls within
Counter ← 1
specified upper and lower limits.
REPEAT
IF Value = Array[Counter] REPEAT
THEN INPUT Value
Found ← TRUE IF Value < MinimumValue OR Value > MaximumValue
ELSE THEN
Counter ← Counter + 1 OUTPUT "The student's mark should be in the range", Min
ENDIF ENDIF
UNTIL Found OR Counter > NumberOfValues UNTIL Value >= MinimumValue AND Value <= MaximumVa
IF Found
THEN Length check
OUTPUT Value , " found at position " , Counter, " in the list."
ELSE This can either ensure that data consists of a precise number
OUTPUT Value , " not found." of characters.
ENDIF
OUTPUT "Please enter your value of ", Limit , " characters
Bubble Sort: Iteratively compare and swap adjacent REPEAT
elements in a list to sort them. Start from the first element INPUT Value
and continue until the second-to-last element. After each IF LENGTH(Value) <> Limit
pass, the last element is in its correct place. However, THEN
other elements may still be unsorted. Repeat the process, OUTPUT "Your value must be exactly" , Limit ," characters
excluding the last element, until only one element ENDIF
remains or no swaps are needed. UNTIL LENGTH(Value) = Limit
WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Ahmad Usaid at Pakistan Internal School Jeddah , Cambridge Curriculum System on 17/05/24.
CAIE IGCSE COMPUTER SCIENCE
Presence check It helps identify errors and assess how the program
handles different scenarios
A presence check checks to ensure that some data has been
entered and the value has not been left blank 1.5. Normal Data
OUTPUT "Please enter the value "
Normal data is the test data which accepts values in
REPEAT
acceptible range of values of the program
INPUT Value
Normal data should be used to work through the solution
IF Value = ""
to find the actual result(s) and see if they are the same as
THEN
the expected result(s)
OUTPUT "*=Required "
e.g. in a program where only whole number values
ENDIF
ranging from 0 to 100 (inclusive) are accepted, normal
UNTIL Value <> ""
test data will be : 23, 54, 64 , 2 and 100
Format Check
Abnormal Data
A format check checks that the characters entered conform
to a pre-defined pattern. Test data that would be rejected by the solution as not
suitable, if the solution is working properly is called
Check Digit abnormal test data / erroneous test data.
e.g. in a program where only whole number values
A check digit is the final digit included in a code; it is ranging from 0 to 100 (inclusive) are accepted, abnormal
calculated from all the other digits. data will be: -1, 151, 200, 67.2, “Sixty-Two” and -520
Check digits are used for barcodes, product codes,
International Standard Book Numbers (ISBN), and Vehicle
Identification Numbers (VIN).
Extreme Data
Extreme data are the largest and smallest values that
Verification
normal data can take
Verification is checking that data has been accurately copied e.g. in a program where only whole number values
ranging from 0 to 100 (inclusive) are accepted, extreme
from one source to another
data will be: 0 and 100
There are 2 methods to verify data during entry ( there are
other methods during data transfer, but they are in paper 1)
Boundary Data
1. Double Entry
This is used to establish where the largest and smallest
Data is inputted twice, potentially by different operators. values occur
The computer system compares both entries and if they At each boundary two values are required: one value is
differ, an error message is displayed, prompting the data accepted and the other value is rejected.
to be reentered. e.g. in a program where only whole number values
ranging from 0 to 100 (inclusive) are accepted, one
2. Screen/Visual check example of boundary data will be: 100 and 101. 100 will
be accepted and 101 will not be accepted
A screen/visual check involves the user manually
reviewing the entered data.
After data entry, the system displays the data on the Trace Table
screen and prompts the user to confirm its accuracy
before proceeding. A trace table is utilized to document the outcomes of
The user can compare the displayed data against a paper every step in an algorithm. It is employed to record the
document used as an input form or rely on their own variable's value each time it undergoes a change.
knowledge to verify correctness. A dry run refers to the manual process of systematically
executing an algorithm by following each step in
sequence.
Test Data A trace table is set up with a column for each variable and
a column for any output e.g.
Test data refers to input values used to evaluate and
assess the functionality and performance of a computer
program or system.
WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Ahmad Usaid at Pakistan Internal School Jeddah , Cambridge Curriculum System on 17/05/24.
CAIE IGCSE COMPUTER SCIENCE
Test data is employed to execute a dry run of the flowchart Trace tables can be used to trace errors in a program. For
and document the outcomes in a trace table. During the dry example, if the requirement for the previous question
run: would be to accept riders that are of height 1.2 too, rather
than rejecting them, then the error would have been
Whenever a variable's value changes, the new value is caught in the trace table as when 1.2 is entered, it would
recorded in the respective column of the trace table. increment rejected which it shouldn’t in our example
Each time a value is outputted, it is displayed in the output
column.
How to write an algorithm?
An example of trace table is given below using a past paper
question: The ability to write an algorithm is very important for this
Q: The flowchart below inputs the height of children who want syllabus and paper. Some key steps/points to be known in-
to ride on a rollercoaster. Children under 1.2 metres are order to write the perfect algorithm are as follows:
rejected. The ride starts when eight children have been
accepted. 1. Make sure that the problem is clearly understood
which includes knowing the purpose of the algorithm
and the tasks to be completed by the algorithm.
2. Break the problem into smaller problems (e.g. in a
program which outputs average values, divide the
problem into multiple ones i.e. how to count the
number of iterations and how to count the total of all
values)
3. Identify the data that is needed to be saved into
variables/constants/arrays and what datatype it is,
and declare all the variables/constants/arrays
accordingly, with meaningfull names
4. Decide on how you are going to construct your
algorithm, either using a flowchart or pseudocode. If
you are told how to construct your algorithm, then
follow the guidance.
5. Construct your algorithm, making sure that it can be
easily read and understood by someone else. Take
particular care with syntax e.g. when conditions are
used for loops and selection.
6. Use several sets of test data (Normal, Abnormal and
Complete the trace table for the input data: 1.4, 1.3, 1.1, 1.3, Boundary) to dry run your algorithm and check if the
1.0, 1.5, 1.2, 1.3, 1.4, 1.3, 0.9, 1.5, 1.6, 1.0 expected results are achieved (a trace table can be
used for this purpose) . If error is found, find the point
Riders Reject Height OUTPUT
of error in the trace table and fix it in the code.
0 0
1 1.4 Note: The algorithms that you have looked at so far in these
2 1.3 notes were not designed with readability in mind because you
needed to work out what the problem being solved was.
1 1.1
3 1.3
2 1.0 2. Programming
4 1.5
3 1.2 2.1. Programming Languages
5 1.3
6 1.4 There are many high-level programming languages to
choose from. We will only be treating Python, Visual Basic, or
7 1.3
Java.
4 0.9
WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Ahmad Usaid at Pakistan Internal School Jeddah , Cambridge Curriculum System on 17/05/24.
CAIE IGCSE COMPUTER SCIENCE
A variable within a computer program refers to a named The ordering of the steps in an algorithm is very important.
storage unit with a value that can be modified throughout An incorrect order can lead to incorrect results and/or extra
the program's execution. To enhance comprehension for steps that are not required by the task.
others, it is advisable to assign significant names to
variables. Selection
A constant within a computer program represents a
Selection is a very useful technique, allowing different routes
named storage unit that holds a value which remains
through the steps of a program. The code of this is explained
unchanged throughout the program's execution. Similar
in the notes of previous chapters.
to variables, it is recommended to assign meaningful
names to constants to enhance comprehensibility for
Iteration
others.
As explained in the previous chapter, we already
Data Types
Totalling and Counting
Different data types are assigned to computer systems
for effective processing and storage.
As explained in the previous chapter, we already
Data types allow data, such as numbers or characters, to
be stored appropriately. String Handling
Data types enable effective manipulation using
mathematical operators for numbers and character Strings are used to store text and can contain various
concatenation. characters.
Some data types provide automatic validation. An empty string has no characters, while the
The types of datatypes are told in Chapter 1 already! programming language specifies the maximum number
of characters allowed.
Input and Output Characters in a string can be identified by their position
number, starting from either zero or one, depending on
Programs require input and output statements to handle the programming language.
data. String handling is an important aspect of programming.
In IGCSE Computer Science, algorithms and programs are
In IGCSE Computer Science, you will need to write
designed to take input from a keyboard and output to a
algorithms and programs for the following string
WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Ahmad Usaid at Pakistan Internal School Jeddah , Cambridge Curriculum System on 17/05/24.
CAIE IGCSE COMPUTER SCIENCE
WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Ahmad Usaid at Pakistan Internal School Jeddah , Cambridge Curriculum System on 17/05/24.
CAIE IGCSE COMPUTER SCIENCE
Integrated Development Environments (IDEs) typically A two-dimensional array can be referred to as a table with
include a standard library of functions and procedures. rows and columns.
Standard library routines perform various tasks, including
string handling.
MOD – returns the remainder of a division
DIV – returns the quotient (i.e. the whole number part) of a
division
ROUND – returns a value rounded to a given number of
decimal places
RANDOM – returns a random number.
Examples:
Declaring a 2D Array:
2.5. Creating a Maintainable Program
DECLARE Name : ARRAY[RowLower:RowUpper,ColumnLowe
A maintainable program should:
Filling a 2-D array using a loop:
always use meaningful identifier names for variables,
FOR ColumnCounter ← 0 TO 2
constants, arrays, procedures and functions
FOR RowCounter ← 0 TO 9
be divided into modules for each task using procedures
OUTPUT "Enter next value "
and functions
be fully commented using your programming language’s INPUT ArrayName [RowCounter, ColumnCounter]
NEXT RowCounter
commenting feature
NEXT ColumnCounter
Commenting in pseudocode:
// Now the text written is commented and thus ignored File Handling
"" Computer programs store data that will be needed again
This method can also be used to comment in a file.
multiple lines but the singular line method Data stored in RAM is volatile and will be lost when the
is more widely accepted and reccomended too computer is powered off.
"" Data saved to a file is stored permanently, allowing it to
be accessed by the same program at a later date or by
2.6. Arrays other programs.
Stored data in a file can be transferred and used on other
An array is a data structure containing several elements computers.
of the same data type; these elements can be accessed The storage of data in files is a commonly used feature in
using the same identifier name. programming.
The position of each element in an array is identified
Key point: When writing in a file, the program is outputing the
using the array’s index.
data to the file, and when reading a file, the program in
There are two types of arrays
inputing the data from the file
\n There are 3 ways a file can be opened in a program i.e. to
One-Dimensional Array
write, to read and to append
Explained in the previous chapter in detail
2.7. Writing in a file
Two-Dimensional Array
OPENFILE "filename.txt" FOR WRITE
WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Ahmad Usaid at Pakistan Internal School Jeddah , Cambridge Curriculum System on 17/05/24.
CAIE IGCSE COMPUTER SCIENCE
//When opening a file to write, all the data already existing in the entities that are written later in records e.g. car name, car
file is OVERWRITTEN
manufacturer etc.
WRITEFILE "filename.txt" , Value Note: In this chapter, skills of dealing with a database are also
required so working with Microsoft Access is needed to
understand
// The next command of WRITEFILE would be writen on next line of the filethis chapter better. You have to be able to define
a single-table database from given data storage
CLOSEFILE "filename.txt" requirements, choose a suitable primary key for a database
table and also be able to read, complete and understand SQL
scripts.
Reading a file:
OPENFILE "filename.txt" FOR READ
READFILE "filename.txt" , Variable
// The value in the line (which is identified by the number of times this is being run) is stored in the variable
CLOSEFILE "filename.txt"
WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Ahmad Usaid at Pakistan Internal School Jeddah , Cambridge Curriculum System on 17/05/24.
CAIE IGCSE COMPUTER SCIENCE
SQL Scripts
Select Statements:
SELECT (fieldsname)
FROM (tablesname) 4. Boolean Logic
WHERE (condition)
ORDER BY (sortingcondition) ;
4.1. Logic Gates and their functions
Selecting Sum of values in a table:
A B Output
WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Ahmad Usaid at Pakistan Internal School Jeddah , Cambridge Curriculum System on 17/05/24.
CAIE IGCSE COMPUTER SCIENCE
A B Output
0 0 0
Writing Logic Statements
0 1 0
Logic Statements is a way of showing all the logics that are in
1 0 0 place for a logic circuit.
1 1 1
4.2. Writing from a logic circuit
1. Look at the ciruit and go around the logic gates used in
the circuit
2. Go from the one output that is being given towards the
OR gate: A + B input
3. Write the last gate ( the first gate you walk through ) in
A B Output the middle and then, for each of the value coming into
0 0 0 the gate, leave space at the side
0 1 1 4. If the value coming into the gate is coming from
1 0 1 another gate, use a bracket for the gate’s logic
5. Repeat process 3-4 till you are able to reach the input
1 1 1
values fully
XOR gate: A ⨁ B
A B Output
0 0 0
0 1 1
1 0 1
1 1 0 Creating Truth Tables
4.3. From Logic Circuits
WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Ahmad Usaid at Pakistan Internal School Jeddah , Cambridge Curriculum System on 17/05/24.
CAIE IGCSE COMPUTER SCIENCE
1. Create a truth table with each input possible, creating 1. Given the truth table above, take the rows where the
every possible combination of inputs . Tip: For the first output (x) is 1 (Rows 1, 2, 4, 5, 6, 7)
input, write it in the combination of 1,0,1,0 and so on. 2. Create a logic expression from these rows (example,
For the second, go 1,1,0,0 and so on, and for the third row 1 will be (NOT A AND NOT B AND NOT C) = X
one, go 1,1,1,1,0,0,0,0 going by the powers of 2 for 3. Create logic expressions for all the rows with output 1
each input. This would guarantee each possible and connect them with OR gate
combination
2. Run through the circuit with the inputs and get the
output that will be reached and write it accordingly Exam-Style Question
For logic statements, and problem statements,
convert them to logic circuits first and then do the
rest
Example
This is the example of a truth table of a logic circuit
WWW.ZNOTES.ORG Copyright © 2024 ZNotes Education & Foundation. All Rights Reserved. This document is authorised
for personal use only by Ahmad Usaid at Pakistan Internal School Jeddah , Cambridge Curriculum System on 17/05/24.
CAIE IGCSE
Computer Science
© ZNotes Education Ltd. & ZNotes Foundation 2024. All rights reserved.
This version was created by Ahmad Usaid on 17/05/24 for strictly personal use only.
These notes have been created by Abdullah Aamir, Abhiram Mydi and Shriram Srinivas for the 2023-2025 syllabus
The document contains images and excerpts of text from educational resources available on the internet and
printed books. If you are the owner of such media, test or visual, utilized in this document and do not accept its
usage then we urge you to contact us and we would immediately replace said media.
No part of this document may be copied or re-uploaded to another website. Under no conditions may this
document be distributed under the name of false author(s) or sold for financial gain.
“ZNotes” and the ZNotes logo are trademarks of ZNotes Education Limited (registration UK00003478331).