Kramizo
Log inSign up free
HomePearson Edexcel International IGCSE Computer ScienceProblem-Solving and Programming: Programming
Pearson Edexcel International · IGCSE · Computer Science · Revision Notes

Problem-Solving and Programming: Programming

1,844 words · Last updated July 2026

Ready to practise? Test yourself on Problem-Solving and Programming: Programming with instantly-marked questions.
Practice now →
Quick answer

Programming requires understanding of five data types (integer, real, Boolean, character, string) and three key constructs: selection (IF statements), iteration (FOR, WHILE, REPEAT-UNTIL loops), and procedures/functions. Master arithmetic operators (including DIV and MOD), comparison operators, and logical operators (AND, OR, NOT). Know when to use each loop type and understand the difference between local and global variable scope. Procedures promote code reuse and modularity. Parameters pass data into procedures, which can return values when defined as functions. Practice writing clear pseudocode using correct syntax and appropriate data structures.

What you'll learn

This revision guide covers the programming fundamentals required for Pearson Edexcel International IGCSE Computer Science. You'll master the core programming constructs including variables, data types, arithmetic and logical operators, selection statements, iteration, and procedures. These concepts form the foundation for both Paper 1 theory questions and Paper 2 practical programming tasks.

Key terms and definitions

Variable — a named storage location in memory that holds a value which can change during program execution

Data type — classification that specifies which type of value a variable can hold (integer, real, Boolean, character, string)

Assignment — the process of storing a value in a variable using the assignment operator (=)

Selection — a programming construct that allows different code to execute based on whether a condition is true or false (IF statements)

Iteration — a programming construct that repeats a section of code multiple times, either for a fixed number of times or while a condition remains true (loops)

Procedure — a named block of code that performs a specific task and can be called from other parts of the program

Parameter — a variable passed into a procedure or function to provide it with data to work with

Scope — the region of a program where a variable can be accessed (local or global)

Core concepts

Variables and data types

Variables must be declared before use in many programming languages. The declaration specifies the variable name and its data type.

The five main data types you need to know:

  • Integer — whole numbers (positive, negative, or zero), e.g. 42, -17, 0
  • Real — numbers with decimal points, e.g. 3.14, -0.5, 2.0
  • Boolean — logical values that can only be TRUE or FALSE
  • Character — a single alphanumeric symbol, e.g. 'A', '7', '?'
  • String — a sequence of characters, e.g. "Hello", "CS2024"

Example declarations in pseudocode:

DECLARE age : INTEGER
DECLARE price : REAL
DECLARE found : BOOLEAN
DECLARE initial : CHAR
DECLARE name : STRING

Variables are assigned values using the assignment operator:

age ← 16
price ← 12.99
found ← FALSE
initial ← 'K'
name ← "Sarah"

Arithmetic and logical operators

Arithmetic operators perform mathematical calculations:

  • + addition
  • - subtraction
  • * multiplication
  • / division (real division)
  • DIV integer division (quotient only)
  • MOD modulus (remainder after division)

Example calculations:

result ← 17 DIV 5    // result = 3
remainder ← 17 MOD 5  // remainder = 2
total ← price * 1.2   // adds 20% to price

Comparison operators compare two values and return a Boolean result:

  • = equal to
  • <> not equal to
  • < less than
  • > greater than
  • <= less than or equal to
  • >= greater than or equal to

Logical operators combine Boolean expressions:

  • AND — true only if both conditions are true
  • OR — true if at least one condition is true
  • NOT — reverses the Boolean value

Example:

IF age >= 16 AND hasID = TRUE THEN
    OUTPUT "Entry permitted"
END IF

Selection statements

Selection allows programs to make decisions and execute different code based on conditions.

IF statement executes code only when a condition is true:

IF temperature > 30 THEN
    OUTPUT "It's hot today"
END IF

IF-ELSE statement provides an alternative path:

IF mark >= 50 THEN
    OUTPUT "Pass"
ELSE
    OUTPUT "Fail"
END IF

Nested IF statements allow multiple conditions to be tested:

IF mark >= 70 THEN
    grade ← 'A'
ELSE
    IF mark >= 60 THEN
        grade ← 'B'
    ELSE
        IF mark >= 50 THEN
            grade ← 'C'
        ELSE
            grade ← 'F'
        END IF
    END IF
END IF

CASE/SWITCH statements provide cleaner code for multiple conditions:

CASE OF choice
    1: OUTPUT "You chose option 1"
    2: OUTPUT "You chose option 2"
    3: OUTPUT "You chose option 3"
    OTHERWISE OUTPUT "Invalid choice"
END CASE

Iteration (loops)

Iteration allows code to repeat. There are three main types:

FOR loop — repeats a fixed number of times:

FOR counter ← 1 TO 10
    OUTPUT counter
END FOR

Use FOR loops when you know how many iterations are needed.

WHILE loop — repeats while a condition remains true, testing the condition before each iteration:

WHILE password <> "secret" DO
    INPUT password
END WHILE

The code inside may execute zero times if the condition is initially false.

REPEAT-UNTIL loop — repeats until a condition becomes true, testing the condition after each iteration:

REPEAT
    INPUT password
UNTIL password = "secret"

The code inside always executes at least once.

Nested loops place one loop inside another:

FOR row ← 1 TO 3
    FOR col ← 1 TO 4
        OUTPUT "*"
    END FOR
    OUTPUT newline
END FOR

This prints a 3×4 grid of asterisks.

Procedures and functions

Procedures and functions promote code reuse and modularity.

Procedures perform a task but don't return a value:

PROCEDURE greetUser(userName : STRING)
    OUTPUT "Hello, " + userName
END PROCEDURE

// Calling the procedure
greetUser("James")

Functions perform a calculation and return a value:

FUNCTION calculateArea(length : REAL, width : REAL) RETURNS REAL
    RETURN length * width
END FUNCTION

// Calling the function
area ← calculateArea(5.0, 3.0)

Parameters pass data into procedures/functions. They can be:

  • Value parameters — a copy of the data is passed; changes don't affect the original
  • Reference parameters — the actual variable is passed; changes affect the original

Benefits of using procedures and functions:

  • Code reusability — write once, use many times
  • Easier testing — test individual components
  • Easier maintenance — changes only needed in one place
  • Improved readability — meaningful names clarify purpose
  • Reduces code duplication

Variable scope

Local variables are declared inside a procedure/function and can only be accessed within that block. They are created when the procedure is called and destroyed when it ends.

Global variables are declared outside all procedures/functions and can be accessed from anywhere in the program.

Example:

DECLARE totalScore : INTEGER  // Global variable
totalScore ← 0

PROCEDURE addScore(points : INTEGER)
    DECLARE bonus : INTEGER   // Local variable
    bonus ← points * 2
    totalScore ← totalScore + bonus
END PROCEDURE

Best practice: use local variables wherever possible to avoid unintended side effects and make code easier to understand and debug.

Worked examples

Example 1: Validation with selection and iteration

Question: Write pseudocode that repeatedly asks a user to enter a number between 1 and 100 until a valid number is entered. Use a REPEAT-UNTIL loop and appropriate validation. [4 marks]

Answer:

DECLARE number : INTEGER

REPEAT
    OUTPUT "Enter a number between 1 and 100: "
    INPUT number
    IF number < 1 OR number > 100 THEN
        OUTPUT "Invalid input. Try again."
    END IF
UNTIL number >= 1 AND number <= 100

OUTPUT "Valid number entered: " + number

Mark scheme points:

  • Use of REPEAT-UNTIL loop (1 mark)
  • Correct input of number (1 mark)
  • Validation condition checking both lower and upper bounds (1 mark)
  • Appropriate UNTIL condition to exit loop (1 mark)

Example 2: Function with parameters

Question: Write a function called isEven that takes one integer parameter and returns TRUE if the number is even, FALSE otherwise. Then write code to call this function for the number 42. [4 marks]

Answer:

FUNCTION isEven(num : INTEGER) RETURNS BOOLEAN
    IF num MOD 2 = 0 THEN
        RETURN TRUE
    ELSE
        RETURN FALSE
    END IF
END FUNCTION

DECLARE result : BOOLEAN
result ← isEven(42)

Mark scheme points:

  • Correct function header with parameter and return type (1 mark)
  • Use of MOD operator to test for even number (1 mark)
  • Appropriate RETURN statements (1 mark)
  • Correct function call with argument (1 mark)

Example 3: Nested loops

Question: Write pseudocode using nested FOR loops to output a times table from 1×1 to 10×10, displaying each result in the format "3 x 4 = 12". [5 marks]

Answer:

DECLARE row : INTEGER
DECLARE col : INTEGER
DECLARE result : INTEGER

FOR row ← 1 TO 10
    FOR col ← 1 TO 10
        result ← row * col
        OUTPUT row + " x " + col + " = " + result
    END FOR
END FOR

Mark scheme points:

  • Outer FOR loop with correct range (1 mark)
  • Inner FOR loop with correct range (1 mark)
  • Calculation of result (1 mark)
  • Correct output format with all components (1 mark)
  • Appropriate use of variable declarations (1 mark)

Common mistakes and how to avoid them

  • Confusing assignment with comparison — remember that or = assigns a value, while comparison operators test equality. In an IF statement, use IF x = 5 not IF x ← 5.

  • Off-by-one errors in loops — check whether your loop should run TO 10 or TO 9. Remember that FOR i ← 1 TO 10 includes both 1 and 10 (executes 10 times).

  • Using the wrong loop type — use FOR when you know the iteration count, WHILE when testing before execution, REPEAT-UNTIL when you need at least one execution.

  • Forgetting MOD vs DIV — MOD gives the remainder (17 MOD 5 = 2), DIV gives the quotient (17 DIV 5 = 3). Don't mix them up.

  • Scope errors — attempting to use a local variable outside its procedure will cause an error. Declare variables in the appropriate scope.

  • Incorrect parameter passing — ensure the data types of arguments match the parameter types defined in the procedure/function header.

Exam technique for "Problem-Solving and Programming: Programming"

  • Command word "Write" requires you to produce code in pseudocode or a specified language. Include all necessary elements: declarations, appropriate constructs, and correct syntax. Typically 3-6 marks depending on complexity.

  • Show your working in trace tables — when asked to trace through code, create a clear table with columns for each variable and show values after each step. This can earn partial marks even if the final answer is wrong.

  • Explain advantages of procedures/functions — focus on specific benefits: reusability, easier testing, maintenance, readability. Generic answers like "it makes code better" score zero marks.

  • Read the question carefully — if asked for a WHILE loop, don't write a FOR loop. If the question specifies "between 1 and 100", ensure your validation includes both boundaries correctly.

Quick revision summary

Programming requires understanding of five data types (integer, real, Boolean, character, string) and three key constructs: selection (IF statements), iteration (FOR, WHILE, REPEAT-UNTIL loops), and procedures/functions. Master arithmetic operators (including DIV and MOD), comparison operators, and logical operators (AND, OR, NOT). Know when to use each loop type and understand the difference between local and global variable scope. Procedures promote code reuse and modularity. Parameters pass data into procedures, which can return values when defined as functions. Practice writing clear pseudocode using correct syntax and appropriate data structures.

Problem-Solving and Programming: Programming: common questions

What do you need to know about Problem-Solving and Programming: Programming for Pearson Edexcel International IGCSE Computer Science?

Programming requires understanding of five data types (integer, real, Boolean, character, string) and three key constructs: selection (IF statements), iteration (FOR, WHILE, REPEAT-UNTIL loops), and procedures/functions. Master arithmetic operators (including DIV and MOD), comparison operators, and logical operators (AND, OR, NOT). Know when to use each loop type and understand the difference between local and global variable scope. Procedures promote code reuse and modularity. Parameters pass data into procedures, which can return values when defined as functions. Practice writing clear pseudocode using correct syntax and appropriate data structures.

What are the most common mistakes in Problem-Solving and Programming: Programming?

Confusing assignment with comparison: remember that ← or = assigns a value, while comparison operators test equality. In an IF statement, use IF x = 5 not IF x ← 5. Off-by-one errors in loops: check whether your loop should run TO 10 or TO 9. Remember that FOR i ← 1 TO 10 includes both 1 and 10 (executes 10 times). Using the wrong loop type: use FOR when you know the iteration count, WHILE when testing before execution, REPEAT-UNTIL when you need at least one execution.

Where can I practise Problem-Solving and Programming: Programming questions for free?

Kramizo has free Pearson Edexcel International IGCSE Computer Science practice questions on Problem-Solving and Programming: Programming, each marked instantly with a full explanation. No card is required.

Free for IGCSE students

Lock in Problem-Solving and Programming: Programming with real exam questions.

Free instantly-marked Pearson Edexcel International IGCSE Computer Science practice — 45 questions a day, no card required.

Try a question →See practice bank