← IGCSE Computer Science Paper 2

Double entry check in pseudocode

Double entry check: INPUT the value twice inside a REPEAT loop and stop only when both are equal. Output a message if they do not match, so typing mistakes are caught.

Understanding Double entry check in pseudocode in IGCSE Computer Science Paper 2

What it does: Two INPUT statements store the first and second entries in separate variables so they can be compared. REPEAT ... UNTIL keeps asking for both entries until Password1 equals Password2. The message must appear each time the entries differ, so it goes inside the loop. After the loop the values are already equal. Double entry is a verification method. It checks that the data was typed correctly, not that the data is sensible or secure. If the user makes the identical typing error twice, the two entries still match. Verification does not guarantee the data is right. Comparing a value with itself can never catch a typing mistake. Two separate entries are needed for a double entry check.

Common mistakes: A double entry check uses a REPEAT ... UNTIL loop so both values are entered at least once. Line 1 should be REPEAT, not WHILE, because the loop ends with UNTIL. READ is not a Cambridge pseudocode keyword. The first entry must be read with INPUT Password1.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 60–70) and word search (Modules 47–70).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
Which pseudocode loop condition completes a double entry check for two passwords?
UNTIL Password1 = Password2UNTIL Password1 <> Password2
Matches
UNTIL Password1 <> Password2
↓
The condition uses <> so the loop stops when the entries are different. It should use = so it stops only when they match.
Applying
Meanings
Term
UNTIL Password1 = Password2
Meaning
Double entry check: INPUT the value twice inside a REPEAT loop and stop only when both are equal. Output a message if they do not match, so typing mistakes are caught.
Practice
REPEAT
Testing
Gaps
Check Answer
Spots
1WHILE
2 INPUT Password1

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Squirrel' badge — Module Hoarder, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. Which pseudocode loop condition completes a double entry check for two passwords?
A. UNTIL Password1 = Password2 ✓
B. UNTIL Password1 <> Password2
The loop must repeat until the two entries are equal. UNTIL Password1 = Password2 stops only when they match.
2. How many INPUT statements does a double entry check need for one value?
A. Two: INPUT Password1 and INPUT Password2 ✓
B. One: INPUT Password1 only
The value is typed twice so the two entries can be compared. One INPUT gives nothing to compare.
3. Which loop type suits a double entry check, where the user must enter the values at least once?
A. FOR ... TO ... NEXT
B. REPEAT ... UNTIL ✓
REPEAT ... UNTIL runs the body at least once and keeps repeating until the condition is true. A FOR loop repeats a fixed number of times.
4. Where should the message for a mismatch be placed?
A. After the loop, so it is always shown once
B. Inside the loop, in an IF Password1 <> Password2 statement ✓
The message must appear each time the entries differ, so it goes inside the loop. After the loop the values are already equal.
5. Which message belongs in the IF statement of a double entry check?
A. OUTPUT "Passwords do not match, try again" ✓
B. OUTPUT "Passwords match"
The IF tests for Password1 <> Password2, so the message tells the user the entries differ and asks them to try again.

Match the Pairs

UNTIL Password1 = Password2 → The loop repeats until the two typed values are equal, so the double entry check passes
OUTPUT "Passwords do not match" → Tells the user the two entries were different so they must type them again
A double entry check asks for the same value twice using two INPUT statements → INPUT Password1 INPUT Password2
The two entries are compared inside a REPEAT loop that only ends when they are equal → REPEAT INPUT Password1 INPUT Password2 UNTIL Password1 = Password2
UNTIL Password1 <> Password2 → The condition uses <> so the loop stops when the entries are different. It should use = so it stops only when they match.
REPEAT INPUT Password1 UNTIL Password1 = Password1 → There is only one INPUT and the variable is compared with itself, so it is always true. There must be a second INPUT into Password2 and the condition must compare Password1 = Password2.

Key Term

UNTIL Password1 = Password2
Double entry check: INPUT the value twice inside a REPEAT loop and stop only when both are equal. Output a message if they do not match, so typing mistakes are caught.

Fill in the Blanks

1. REPEAT INPUT Password1 INPUT Password2
Hint: Type the keyword that starts the loop, so both entries can be asked again.
2. INPUT Password2 UNTIL Password1 = Password2
Hint: Type the keyword that ends a REPEAT loop and gives its stopping condition.
3. UNTIL Password1 = Password2
Hint: Type the relational operator that checks whether the two entries are equal.
4. IF Password1 <> Password2 THEN OUTPUT "Passwords do not match" ENDIF
Hint: Type the operator that is true when the two entries are not equal.
5. IF Password1 <> Password2 THEN OUTPUT "Passwords do not match" ENDIF
Hint: Type the command that shows an error message to the user.

Spot the Error

Question 1
A WHILE
B INPUT Password1
C INPUT Password2
D OUTPUT "Passwords must match"
E UNTIL Password1 = Password2
Line A — A double entry check uses a REPEAT ... UNTIL loop so both values are entered at least once. Line 1 should be REPEAT, not WHILE, because the loop ends with UNTIL.
Question 2
A REPEAT
B READ Password1
C INPUT Password2
D OUTPUT "Passwords must match"
E UNTIL Password1 = Password2
Line B — READ is not a Cambridge pseudocode keyword. The first entry must be read with INPUT Password1.
Question 3
A OUTPUT "Choose a password"
B REPEAT
C INPUT Password2
D INPUT Password2
E UNTIL Password1 = Password2
Line C — Line 3 should store the first entry in Password1. Reading into Password2 twice means Password1 never gets a value, so the two entries cannot be compared properly.
Question 4
A REPEAT
B INPUT Password1
C INPUT Password2
D UNTIL Password1 <> Password2
Line D — The loop must repeat until the two entries are equal. Using <> would stop the loop when the entries are different, which is the opposite of a double entry check. It should be UNTIL Password1 = Password2.
Question 5
A OUTPUT "Type it twice"
B LOOP
C INPUT Password1
D INPUT Password2
E UNTIL Password1 = Password2
Line B — LOOP is not a Cambridge pseudocode keyword. The loop must start with REPEAT to match the UNTIL at the end.

Student with a class code? Join your class →