1️⃣ What is an Algorithm?
Answer:
An algorithm is a step-by-step set of instructions used to solve a problem.
Why is it used?
It is used to plan the solution before writing a program.
Advantages:
Easy to understand
Language independent
Helps find errors
2️⃣ What is Pseudocode?
Answer:
Pseudocode is a language Independent tool to design programs using simple
English with programming keywords.
Pseudocode is made up of two words – Pseudo + Code. Pseudo means not real.
Code is the programming statements which we use to write computer code.
Why is it used?
It is used to design and explain program logic before coding.
Advantages:
Easy to convert into real code
No strict syntax rules
Easy for beginners
Language Independent
Why is Pseudocode called Language Independent?
✅ Answer:
Pseudocode is called language independent because it is not written in any specific
programming language.
It can be converted into any programming language like Python, Java or C++.
What are the two signs that can be used for Assignment in Pseudocode?
✅ Answer:
In pseudocode, two signs are commonly used for assignment:
1️⃣ ← (Left Arrow)
This is the most commonly used assignment symbol in pseudocode.
Example:
total ← 10
It means: store 10 in the variable total.
2️⃣ = (Equals Sign)
Some pseudocode formats also use the equals sign (=) for assignment.
Example:
total = 10
It also means: store 10 in total.
3️⃣ What is a Flowchart?
Answer:
A flowchart is a diagram that shows the steps of a process using standard symbols and
arrows.
Why is it used?
It is used to show the flow of a program visually.
Advantages:
Easy to understand
Shows sequence clearly
Helps detect mistakes
4️⃣ What is the difference between Algorithm, Pseudocode and Flowchart?
Answer:
Algorithm: Written in simple step-by-step English.
Pseudocode: Written like program code using structured English.
Flowchart: Created as a diagram using symbols.
5️⃣ What is a High-Level Programming Language?
Answer:
A high-level programming language is a language that is easy for humans use for
communication with the computer.
Examples: Python, Java, C++
6️⃣ What is Syntax?
Answer:
Syntax is the set of rules for writing correct program statements.
If syntax is wrong, the program shows an error.
7️⃣ What is a Variable?
Answer:
A variable is a named storage location used to store data.
Example:
x = 10
Here, x is the variable.
8️⃣ What is Assignment?
Answer:
Assignment means storing a value to a variable using the = symbol.
Example:
x=5
9️⃣ What are the rules for naming a Variable?
Answer:
Must start with a letter or underscore
Cannot start with a number
No spaces allowed
No special symbols (@, #, %, etc.)
Cannot use keywords (if, else, while)
🔟 What are the rules of Pseudocode?
Answer:
Use START and STOP
Use double quotation marks around Strings.
Write one instruction per line
Use capital keywords (INPUT, OUTPUT, IF)
Indent inside IF and LOOP
Keep it clear and simple
What is the difference between Program and Pseudocode?
Answer:
A Program is
o Written in a real programming language using proper syntax.
o It is language dependent.
o This is executed by the computer.
Pseudocode is
o Written in simple English without any syntax.
o This is language Independent.
o This is not executed by the computer.
What is an Identifier?
Answer:
An identifier is the name given to a variable, function or program element.
Example:
age = 12
Here, age is an identifier.
If the identifier is missing, the program gives an error.
What are the Rules for Identifier in Pseudocode?
1. It must start with a letter (A–Z or a–z).
2. It cannot start with a number.
3. It must not contain spaces.
4. It must not contain special symbols like @, #, %, &, etc.
5. It must not be a keyword (like IF, THEN, ELSE, INPUT, OUTPUT).
6. It should be meaningful and clear (e.g., totalMarks, not x1)
What do you mean by Concatenation?
Answer:
Concatenation means joining two or more strings together.
Example:
"Hello" + "World"
What ways or symbols you can use to Concatenate?
1. Comma (,)
2. Plus Sign (+)
3. Ampersand &
What do you mean by Variable Declaration?
Answer:
Variable Declaration are the statements that tell a program we need Variable.
Example:
int age
✅ What is Input?
Answer:
Input is the data given by the user to the computer.
Example:
Typing your name into a program.
What are the key Elements in an Input Statements?
A Command word for Input
A Variable to store the input in
Example: INPUT colour
✅ What is Output?
Answer:
Output is the result produced by the computer and shown on the screen.
Example:
Displaying “Hello Champ” on the screen.
What are the key Elements in an Output Statements?
A Command word for Output
A data to be output or print
Example: OUTPUT data
What is the rule to output specific characters or String?
The Characters or String must be surrounded by double quotations marks.
If we don’t put double quotation marks, the characters will be seen as the identifier for a
variable.
1️⃣ What is an Arithmetic Operator?
Answer:
An Arithmetic Operator is a symbol used to perform mathematical calculations.
Examples:
+ Addition
- Subtraction
* Multiplication
/ Division
MOD Remainder
2️⃣ What does “Following a pseudocode algorithm” mean?
Answer:
It means writing or executing steps in the correct logical order as written in pseudocode.
The program must:
Find the Start which might be labelled as “START”
Read the First Statement and then follow each step carefully
Not skip instructions
Maintain proper sequence
Continue until reach either a “STOP” or the last statement
3️⃣ What are Condition and Conditional Statements in Pseudocode?
Answer:
Condition is a comparison test that results in true or false. It is used in conditional
Statements.
Conditional statements are statements that make decisions based on a condition.
They check whether something is true or false.
4️⃣ What are the Elements of a Conditional Statement in Flowchart or Pseudocode?
Answer:
1. A Condition that can be true or false (e.g., x > 10)
2. Statement that run when the Condition is True
3. Statement that run when the Condition is False
Example:
IF marks > 50 THEN
OUTPUT "Pass"
END IF
5️⃣ What are the Rules for Conditional Statements?
Answer:
Must start with IF
Must have a condition
Use THEN after condition
End with END IF
Indent the statements inside
6️⃣ What is a Conditional Statement Often Called?
Answer:
A conditional statement is often called a IF THEN Statement, Decision Statement or
Selection Statement.
7️⃣ Explain Each Conditional Statement
✅ 1. IF THEN
Used when an action happens only if the condition is true.
Example:
IF condition THEN
Statements that run when condition 1 is true
END IF
✅ 2. IF THEN ELSE
Used when there are two possible outcomes.
Example:
IF condition THEN
Statements that run when condition 1 is true
ELSE
Statements that run when condition 1 is false
END IF
✅ 3. IF THEN ELSE IF
Used when there are multiple conditions.
Example:
IF condition 1 THEN
Statements that run when condition 1 is true
ELSE IF condition 2 THEN
Statements that run when condition 1 is false and condition 2 is true
ELSE
Statements that run when both condition 1 and 2 are false
END IF
8️⃣ What is Indentation?
Answer:
Indentation means leaving spaces at the beginning of a line to show that statements belong
inside a condition or loop.
It makes pseudocode:
Neat and clean
Easy to read
Well-structured
Example:
IF x > 10 THEN
OUTPUT "Big"
END IF
(OUTPUT is indented)
✅ Types of Arithmetic Operators
1️⃣ Addition (+)
Used to add two numbers.
Example:
total ← 5 + 3
Result: 8
2️⃣ Subtraction (−)
Used to subtract one number from another.
Example:
difference ← 10 - 4
Result: 6
3️⃣ Multiplication (*)
Used to multiply numbers.
Example:
product ← 6 * 2
Result: 12
4️⃣ Division (/)
Used to divide one number by another.
Example: result ← 8 / 2
Result: 4
5️⃣ MOD (Modulus)
Used to find the remainder after division.
Example: remainder ← 7 MOD 2
Result: 1
(7 ÷ 2 = 3 remainder 1)
📌 Important:
MOD is often used to check if a number is even or odd.
Example:
IF number MOD 2 = 0 THEN
OUTPUT "Even"
END IF
✅ Why Are Arithmetic Operators Used?
To perform calculations
To solve mathematical problems
To process input data
To find totals, averages, percentages
✅ Arithmetic Expression
An arithmetic expression is a combination of:
Numbers
Variables
Arithmetic operators
Example: average ← (math + science + english) / 3
✅ Order of Operations (BODMAS Rule)
Arithmetic operations follow a specific order:
1. Brackets ( )
2. Orders (powers)
3. Division and Multiplication
4. Addition and Subtraction
Example:
5+3*2
Answer = 11 (Multiplication first)
❓ What are Boolean Operators in Pseudocode?
✅ Answer:
Boolean Operators are operators used to combine or modify conditions in a conditional
statement.
They always give a result of TRUE or FALSE.
✅ Types of Boolean Operators
1️⃣ AND
Used when both conditions must be true.
Example:
IF age >= 18 AND age <= 60 THEN
OUTPUT "Allowed"
END IF
✔ Condition is true only if both parts are true.
2️⃣ OR
Used when at least one condition must be true.
Example:
IF day = "Saturday" OR day = "Sunday" THEN
OUTPUT "Holiday"
END IF
✔ Condition is true if one or both conditions are true.
3️⃣ NOT
Used to reverse the condition.
Example:
IF NOT (marks >= 50) THEN
OUTPUT "Fail"
END IF
✅ Truth Table (Simple Understanding)
Condition 1 Condition 2 AND OR
True True True True
True False False True
False True False True
False False False False
✅ What is the use of Brackets?
Brackets ( ) are used to:
Group conditions
Make expressions clear
Control the order of evaluation
Example:
IF (age > 18 AND age < 60) OR student = TRUE THEN
Brackets help the computer know which condition to check first.
✅ Order of Precedence (Boolean)
When no brackets are used, the order is:
1️⃣ NOT (highest)
2️⃣ AND
3️⃣ OR (lowest)
1.3
Sure 👍 Below is a clear, exam-friendly Q & A format for IGCSE Grade 8.
❓ What is a Searching Algorithm?
✅ Answer:
A searching algorithm is a step-by-step method used to find a specific item in a list or
database.
❓ What does a Searching Algorithm do?
✅ Answer:
It checks the data and tells whether:
The item is found, or
The item is not found
❓ Why are Searching Algorithms needed?
✅ Answer:
Searching algorithms are needed to:
Find information quickly
Save time
Work with large amounts of data
Help users locate files, records, or data
❓ Give examples when a program might need to search.
✅ Examples:
Searching for a username on a website
Searching for a file name on a computer
Searching for information on the internet
Searching for a student record in school database
❓ What are different Searching Algorithms?
✅ Answer:
1) Linear Search
2) Binary Search
3) Random Search
❓ Is there one searching algorithm that is always the best?
✅ Answer:
No. The best algorithm depends on:
Size of data
Whether the data is sorted
✔ Linear Search → Best for small or unsorted lists
✔ Binary Search → Best for large, sorted lists
✔ Random Search
❓ What does “Linear” mean?
✅ Answer:
“Linear” means in a straight line or sequence.
In linear search, items are checked one by one from start to end.
❓ What is Linear Search?
✅ Answer:
Linear Search is a method where each item is checked one by one until the required item is
found or the list ends.
❓ How does Linear Search work?
✅ Steps:
1️⃣ Start from the first element
2️⃣ Compare it with the search value
3️⃣ If equal → Stop (Found)
4️⃣ If not → Move to next element
5️⃣ Repeat until found or list ends
❓ Example 1: How will Linear Search find "horse"?
List:
cat, rabbit, mouse, sheep, horse
Steps:
1️⃣ Compare cat with horse → Not match
2️⃣ Compare rabbit → Not match
3️⃣ Compare mouse → Not match
4️⃣ Compare sheep → Not match
5️⃣ Compare horse → Match ✅
✔ Item found at position 5
❓ Example 2: How will Linear Search find number 1?
List:
2, 44, 9, 50, 19, 2
Steps:
1️⃣ Compare 2 → Not match
2️⃣ Compare 44 → Not match
3️⃣ Compare 9 → Not match
4️⃣ Compare 50 → Not match
5️⃣ Compare 19 → Not match
6️⃣ Compare 2 → Not match
✔ Number 1 is not found
1.4
❓ What are Conditional Statements in Python?
✅ Answer:
Conditional statements are used for decision making.
They check whether a condition is True or False.
❓ What is the command word for a Conditional Statement?
✅ Answer:
The main command word is if.
Other related keywords:
elif
else
❓ What is the Syntax (Format)?
IF
if condition:
statement
IF–ELSE
if condition:
statement1
else:
statement2
IF–ELIF–ELSE
if condition1:
statement1
elif condition2:
statement2
else:
statement3
❓ How do you identify the code that runs when the condition is True?
✅ Answer:
The indented block under the if statement runs when the condition is True.
Python uses indentation to show the block of code.
❓ How many else statements can one if have?
✅ Answer:
Only one else is allowed for each if statement.
But you can have many elif statements.
❓ When does the second condition (elif) get tested?
✅ Answer:
The elif condition is tested only if the previous condition is False.
If the first condition is True, the rest are skipped.
❓ What are Boolean Operators in Python?
✅ Answer:
Boolean operators combine conditions and return True or False.
and → Both must be True
or → At least one True
not → Reverses the condition
Order:
1️⃣ not
2️⃣ and
3️⃣ or
❓ What are Common Errors in Conditional Statements?
✅ Answer:
1️⃣ Missing Colon (:)
if age > 18 ❌
Correct:
if age > 18: ✅
2️⃣ Wrong Indentation
No spaces or incorrect spaces cause Indentation Error.
3️⃣ Using = Instead of ==
= is assignment
== is comparison
Wrong:
if age = 18: ❌
Correct:
if age == 18: ✅
4️⃣ Forgetting Indented Block
Python needs at least one indented statement after if.
5️⃣ Wrong Boolean Operator
Confusing and and or.
1.6
Sure 👍 Below is the complete combined notes (original + new topics added together) in exam-friendly Q & A
format.
❓ What are Data Types in Python?
✅ Answer:
A data type tells the computer what kind of data is stored in a variable.
🔑 Key Words:
Type of data, storage, value, memory
❓ Common Data Types in Python (with Examples)
Data Type Meaning Example
int Whole numbers x = 10
float Decimal numbers y = 5.5
str Text name = "Ali"
bool True/False value flag = True
❓ What are the two values stored in a Boolean Data Type?
✅ Answer:
A Boolean data type stores only:
True
False
❓ What is the difference between "True" and True?
"True" True
String data type Boolean data type
Written in quotes No quotes
Text value Logical value
Example:
x = "True" # String
y = True # Boolean
❓ What is a Flag?
✅ Answer:
A flag is a Boolean variable used to control program flow.
Example:
found = False
If something is found:
found = True
🔑 Used for control, condition checking
❓ What is the Correct Syntax of Boolean in Python?
✅ Answer:
Boolean values must start with a capital letter:
✔ True
✔ False
❌ true
❌ false
Python is case-sensitive.
❓ What is Casting?
✅ Answer:
Casting means converting one data type into another.
Example:
x = "10"
y = int(x)
❓ What is Casting to Boolean?
✅ Answer:
Casting to Boolean means converting a value into True or False using bool().
Example:
bool(1) # True
bool(0) # False
bool("Hi") # True
bool("") # False
Rule:
0 → False
Non-zero → True
Empty string → False
Non-empty string → True
❓ What is a Variable?
✅ Answer:
A variable is a named storage location used to store data that can change.
Example:
age = 15
❓ What is a Constant?
✅ Answer:
A constant is a value that does not change during program execution.
In Python, constants are written in capital letters.
Example:
PI = 3.14
❓ Difference Between Variable and Constant
Variable Constant
Value can change Value does not change
Variable Constant
Lowercase name Uppercase name
Used for changing data Used for fixed data
❓ Why are Variables used?
To store input
To store results
To allow value changes
❓ Why are Constants used?
To store fixed values
To prevent accidental change
To make program clear
❓ Constant in Algorithm
Constants are declared at the beginning.
Example:
Step 1: Declare constant PI = 3.14
Step 2: Input radius
Step 3: Area ← PI × radius × radius
Step 4: Output Area
Step 5: Stop
❓ Constant in Pseudocode
Declared using CONSTANT keyword at the top.
Example:
CONSTANT PI ← 3.14
INPUT radius
area ← PI * radius * radius
OUTPUT area
❓ Constant in Flowchart
Written inside a process (rectangle) box at the beginning.
Example (in words):
Start
Process → PI = 3.14
Input radius
Process → area = PI × radius × radius
Output area
Stop
❓ Parts of Constant Declaration
1️⃣ Keyword (CONSTANT)
2️⃣ Name (Capital letters)
3️⃣ Assignment symbol (← or =)
4️⃣ Fixed value
Example:
CONSTANT TAX_RATE ← 0.05Mixed MCQs 😊
🔹 SUBROUTINES
❓ What is a Subroutine?
✅ Answer:
A subroutine is a separate block of code written to perform a specific task inside a program.
Instead of writing the same code many times, we write it once and reuse it.
❓ Why do we use Subroutines?
We use subroutines to:
Break large programs into smaller parts
Avoid writing the same code again
Make programs easier to read
Make testing and debugging easier
Improve program organisation
❓ Advantages of Subroutines
✔ Reduces repetition (no duplicate code)
✔ Makes program shorter
✔ Easier to fix errors
✔ Improves readability
✔ Saves development time
🔹 TYPES OF SUBROUTINES
1️⃣ Function
2️⃣ Procedure
🔹 FUNCTION
❓ What is a Function?
✅ Answer:
A function is a subroutine that performs a task and returns a value back to the program.
It is usually used for calculations.
❓ Why are Functions used?
To calculate values
To return results
To reuse formulas
To make programs organised
❓ Example of a Function
def add(a, b):
return a + b
result = add(5, 3)
print(result)
Here:
a and b are parameters
The function returns a value
❓ Importance of Indentation in Functions
Python uses indentation to show which statements belong inside the function.
Correct:
def greet():
print("Hello")
If not indented:
def greet():
print("Hello") ❌
Python gives IndentationError.
Indentation defines the block of code.
🔹 PROCEDURE
❓ What is a Procedure?
✅ Answer:
A procedure is a subroutine that performs an action but does not return a value.
It is usually used for displaying output or performing tasks.
❓ Example of Procedure
def show_message():
print("Welcome")
This prints a message but does not return a value.
❓ Why are Procedures used?
To perform actions
To improve program structure
To avoid repeating display code
❓ Difference Between Function and Procedure
Function Procedure
Returns a value Does not return value
Uses return No return
Used in calculations Used for actions
❓ What are Parameters?
✅ Answer:
Parameters are values passed into a function or procedure.
Example:
def greet(name):
print("Hello", name)
name is a parameter.
They allow the function to work with different values.
🔹 PROGRAM LIBRARIES
❓ What is a Program Library?
✅ Answer:
A program library is a collection of pre-written and tested functions that programmers can
use.
Instead of writing complex code, we import it.
❓ Why do Libraries exist?
To save time
To avoid rewriting common tasks
To provide reliable, tested functions
To improve program efficiency
❓ Advantages of Libraries
✔ Saves coding time
✔ Reduces errors
✔ Provides advanced features
✔ Makes program shorter
❓ Drawbacks of Libraries
❌ Must import correctly
❌ Need correct syntax
❌ May use extra memory
❌ Wrong usage can cause errors
❓ How to import a library in Python?
import library_name
Example:
import math
🔹 COMMON PYTHON LIBRARIES
🔹 math Library
Used for mathematical operations.
Examples:
import math
[Link](44.56) # 44
[Link](44.56) # 45
[Link] # 3.141592...
❓ What is the function call to round down 44.56?
[Link](44.56)
🔹 random Library
Used to generate random numbers.
import random
[Link](1, 10)
❓ Why are Random Numbers useful?
Games
Simulations
Lottery systems
Testing programs
Password generation
❓ Why must we be careful when using Libraries?
Use correct function name
Provide correct parameters
Import before use
Check version compatibility
1.7
🔹 DECOMPOSING PROBLEMS
❓ What is Decomposition?
✅ Definition:
Decomposition is the process of breaking a large problem into smaller sub-problems.
Why do we use it?
To simplify complex problems
To solve one part at a time
To reduce errors
Advantages:
✔ Easier to understand
✔ Easier to manage
✔ Improves organisation
✔ Makes testing easier
❓ What is a Sub-problem?
✅ Definition:
A sub-problem is a smaller part of a larger problem.
Each sub-problem can be solved separately.
❓ Why do we Decompose Problems?
To make complex tasks manageable
To plan solutions clearly
To improve accuracy
To support teamwork
🔹 Decomposing Non-Programming Problems
❓ Example: Alarm Intruder System
Big Problem:
Design a security alarm system.
Sub-problems:
1️⃣ Detect movement
2️⃣ Check if alarm is activated
3️⃣ Trigger siren
4️⃣ Send alert message
5️⃣ Record time of intrusion
Each part solves one small task.
❓ Example: Morning Routine
Big Problem:
Get ready for school.
Sub-problems:
1️⃣ Wake up
2️⃣ Brush teeth
3️⃣ Shower
4️⃣ Wear uniform
5️⃣ Eat breakfast
6️⃣ Pack bag
Breaking tasks makes it easier to complete.
🔹 Decomposing Programming Problems
❓ What does Decomposing Programs mean?
✅ Definition:
Breaking a program into smaller modules or subroutines (functions/procedures).
❓ Why do we Decompose Programs?
To improve readability
To reuse code
To debug easily
To test individual parts
❓ Difference Between Decomposing Problems and Programs
Decomposing Problems Decomposing Programs
Breaking real-life problem Breaking code into functions
Planning stage Coding stage
Focus on tasks Focus on program structure
🔹 ITERATION
❓ What is Iteration?
✅ Definition:
Iteration means repeating a set of instructions until a condition is met.
Used in loops.
❓ What is Iterative Development?
✅ Definition:
Iterative development is building a program step-by-step, testing and improving it after
each version.
❓ Why do we use Iterative Development?
To find errors early
To improve program gradually
To reduce risk
❓ Advantages of Iterative Development
✔ Continuous improvement
✔ Easier debugging
✔ Better quality output
✔ User feedback possible
🔹 PREDICTION
❓ What is Prediction?
✅ Definition:
Prediction means estimating the expected output of a program before running it.
❓ Why do we Predict Outcomes?
To check logic
To identify possible errors
To understand program behaviour
🔹 TESTING
❓ What is Test Data?
✅ Definition:
Test data is data used as input to check whether a program works correctly.
❓ What is a Test Plan?
✅ Definition:
A test plan is a document that records:
Test data (input)
Expected result
Actual result
Pass/Fail status
❓ Why do we use a Test Plan?
To organise testing
To track errors
To ensure program works correctly
❓ Steps to Create a Test Plan
1️⃣ Identify inputs
2️⃣ Decide expected outputs
3️⃣ Run program
4️⃣ Record actual outputs
5️⃣ Compare results
6️⃣ Mark Pass/Fail
❓ What are the Three Types of Test Data?
1️⃣ Normal Data
Valid data within expected range.
Example: Age = 15 (if range is 10–18)
2️⃣ Boundary Data
Data at the edge of range.
Example: Age = 10 or 18
3️⃣ Invalid Data
Incorrect or unexpected data.
Example: Age = -5 or "Hello"
❓ Why test with a range of data?
To check all possible conditions
To test limits
To ensure reliability
❓ Why test a program multiple times?
To find hidden errors
To check consistency
To improve accuracy
❓ Why test with different types of data?
To check normal cases
To check boundary cases
To check error handling