Session XP: 0
1CP2 P1Edexcel GCSE Computing · 1CP2 Paper 1 (Programming)

Operators and String Handling

Arithmetic, relational and Boolean operators. String functions: length, substring, upper, lower, charAt. Core Paper 1 skills.

—
Best score
—
Last attempt
Best attempt progress
0
XP earned
Watch first
Craig n DaveOperators in pseudocode
Craig n DaveString handling in pseudocode
Reference & Examples

Arithmetic operators — fill in the table

OperatorMeaning / example
+ - * /
MOD
DIV
^ or **
Precedence (BIDMAS)

Relational (comparison) operators — fill in the table

OperatorMeaning
== / !=
< / >
<= / >=
Usage
Example

Boolean (logical) operators — fill in the table

OperatorMeaning / example
AND
OR
NOT
Combined example
Truth table

String operations — fill in the table

OperationMeaning / example
LEN(str)
SUBSTRING(str, start, length)
UPPER(str)
LOWER(str)
str[i]
String concatenation (+)
String handling examples (Edexcel pseudocode)
name = "Ander"
PRINT LEN(name)          // Output: 5
PRINT SUBSTRING(name, 0, 3)   // Output: "And"
PRINT UPPER(name)        // Output: "ANDER"
PRINT name[0]            // Output: "A"

// Checking first character
IF UPPER(name[0]) == "A" THEN
    PRINT "Name starts with A"
END IF

// String concatenation
greeting = "Hello, " + name + "!"
PRINT greeting           // Output: "Hello, Ander!"
MOD and DIV examples
// MOD: remainder
PRINT 10 MOD 3     // Output: 1
PRINT 8 MOD 2      // Output: 0  (so 8 is even)

// DIV: integer division
PRINT 17 DIV 5     // Output: 3
PRINT 17 MOD 5     // Output: 2  (17 = 3*5 + 2)

// Test if number is even
IF num MOD 2 == 0 THEN
    PRINT "Even"
ELSE
    PRINT "Odd"
END IF
Exam practice — 5 questions · 12 marks · 1CP2 Paper 1 style
⚡ Write your pseudocode or answer — the AI marks against the Edexcel 1CP2 Paper 1 mark scheme.
1 markMOD operator1CP2 Paper 1

What is the result of 17 MOD 5?

A 3
B 2
C 5
D 0
1 markString length1CP2 Paper 1

What does LEN("Computing") return?

A 8
B 9
C 10
D 7
3 marksSubstring extraction1CP2 Paper 1

A variable word is assigned the value "Python". Write pseudocode to: (a) print the first 3 characters, (b) print the string in uppercase, (c) print the last character. (3 marks)

Hint: (a) SUBSTRING(str, start, length). (b) UPPER(str). (c) Last index = LEN(str) - 1 because 0-indexed.
+30 XP
4 marksOperators in conditions1CP2 Paper 1

Write pseudocode for a program that: asks the user for a number, then prints "Fizz" if divisible by 3, "Buzz" if divisible by 5, "FizzBuzz" if divisible by both, otherwise prints the number. (4 marks)

Hint: Check FizzBuzz FIRST (both conditions) before checking individual ones. Use MOD to test divisibility.
+40 XP
1 markBoolean operator1CP2 Paper 1

What is the result of: (5 > 3) AND (10 < 8)?

A True
B False
C Error
D 0
Quick recall flashcards

Module complete! 🎉

Score loading...

⚡ +10 XP