← IGCSE Computer Science Paper 2

Double entry check

Data is entered twice and the two entries are compared. Any difference shows a mistake, so the user must enter it again. It misses the same mistake made twice.

Understanding Double entry check in IGCSE Computer Science Paper 2

What it does: A REPEAT loop ends only when both entries are equal. This is the key rule of a double entry check. A mismatch shows a mistake, so the user gets an error message and must enter the data again. The same mistake made twice gives two identical entries. The check cannot tell that the data is wrong. The program does not know how many attempts are needed, so it repeats until the two entries are equal. The <> operator tests for a difference. If the entries do not match, a typing mistake has been found.

Common mistakes: The password should only be accepted when the two entries match. <> means 'not equal', so the program accepts it when they differ. It should be IF Pass1 = Pass2 THEN. The second entry overwrites the first entry because it is read into Email1 again. Email2 never gets a value, so the two entries cannot be compared. It should be INPUT Email2.

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
What is a double entry check?
Checking that the data is in the allowed rangeEntering the same data twice and comparing the two entries
Matches
INPUT Password OUTPUT "Password accepted"
↓
The data is entered only once, so there is nothing to compare. This is not a double entry check.
Applying
Meanings
Term
double entry check
Meaning
Data is entered twice and the two entries are compared. Any difference shows a mistake, so the user must enter it again. It misses the same mistake made twice.
Practice
REPEAT
Testing
Gaps
IF Password1 Password2 THEN
Check Answer
Spots
2INPUT Pass2
3IF Pass1 <> Pass2 THEN

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

The 'Thorny Devil' badge — Detail Master, 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. What is a double entry check?
A. Entering the same data twice and comparing the two entries ✓
B. Checking that the data is in the allowed range
A double entry check is a verification method. The data is typed in two times and the two entries are compared.
2. A user sets a new password and must type it in again to confirm. Which check is this?
A. Double entry check ✓
B. Presence check
Typing the new password twice and comparing the entries is a double entry check.
3. The two password entries are 'Sunset9' and 'Sunest9'. What should the program do?
A. Accept the first entry and ignore the second
B. Ask the user to enter the password again ✓
The entries are different, so at least one has a mistake. The program must ask the user to enter them again.
4. When does a double entry check accept the data?
A. When both entries are exactly the same ✓
B. When the second entry is longer than the first
The entries must match exactly. Any difference shows that a mistake has been made.
5. A user types 'Pasword1' by mistake both times. What happens in a double entry check?
A. The entries match, so the mistake is always caught
B. The entries match, so the mistake is not caught ✓
The same mistake made twice gives two identical entries. The check cannot tell that the data is wrong.

Match the Pairs

INPUT Password1 INPUT Password2 → The same data is entered twice so that the two entries can be compared later.
IF Password1 <> Password2 THEN → Checks whether the two entries are different, which shows that a mistake was made.
The entries must match, so the program accepts the data only when both entries are equal. → UNTIL Password1 = Password2
When the two entries differ, the program asks the user to enter the data again. → OUTPUT "Passwords differ, try again"
INPUT Password OUTPUT "Password accepted" → The data is entered only once, so there is nothing to compare. This is not a double entry check.
Password1 = "cat12", Password2 = "cat12" Output: "Both entries are correct" → Matching entries do not prove the data is correct. The same mistake made twice is not caught.

Key Term

double entry check
Data is entered twice and the two entries are compared. Any difference shows a mistake, so the user must enter it again. It misses the same mistake made twice.

Fill in the Blanks

1. INPUT Password1 INPUT Password2 IF Password1 = Password2 THEN
Hint: Type the relational operator that tests whether the two entries are the same.
2. WHILE Password1 <> Password2 DO INPUT Password2 ENDWHILE
Hint: Type the operator meaning 'not equal', so the loop asks again while the entries differ.
3. REPEAT INPUT Password2 UNTIL Password1 = Password2
Hint: Type the keyword that ends a loop which repeats until the two entries match.
4. IF Password1 <> Password2 THEN OUTPUT "Passwords do not match" ENDIF
Hint: Type the command that shows an error message to the user when the entries differ.
5. Password1 ← "pasword" Password2 ← "pasword" Match ← Password1 = Password2
Hint: Type the variable holding the second entry. The same typing mistake twice still matches, so it is not caught.

Spot the Error

Question 1
A INPUT Pass1
B INPUT Pass2
C IF Pass1 <> Pass2 THEN
D OUTPUT "Accepted"
E ENDIF
Line C — The password should only be accepted when the two entries match. <> means 'not equal', so the program accepts it when they differ. It should be IF Pass1 = Pass2 THEN.
Question 2
A INPUT Email1
B INPUT Email1
C IF Email1 <> Email2 THEN
D OUTPUT "Do not match"
E ENDIF
Line B — The second entry overwrites the first entry because it is read into Email1 again. Email2 never gets a value, so the two entries cannot be compared. It should be INPUT Email2.
Question 3
A DECLARE Pass1 : STRING
B DECLARE Pass2 : INTEGER
C INPUT Pass1
D INPUT Pass2
E IF Pass1 <> Pass2 THEN
F OUTPUT "Enter again"
Line B — Both entries are passwords, so both must be the same data type to be compared. A password is text, so Pass2 should be declared as STRING, not INTEGER.
Question 4
A OUTPUT Pass1
B REPEAT
C INPUT Pass2
D UNTIL Pass1 = Pass2
Line A — The first entry must be read from the user with INPUT. OUTPUT only displays Pass1, so there is no first entry to compare with the second. It should be INPUT Pass1.
Question 5
A INPUT Pass1
B INPUT Pass2
C WHILE Pass1 <> Pass2 DO
D OUTPUT Pass2
E ENDWHILE
Line D — When the entries differ, the user must be asked to enter the data again. OUTPUT Pass2 does not change Pass2, so the loop never ends. It should be INPUT Pass2.

Student with a class code? Join your class →