Past-paper question · 2022 May-June · Paper 22 · Q2(b)

Question 2(b) 2022 · May-June · Paper 22 · 4 marks

Original past-paper question for 2(B)
Original past-paper question for 2(B)
Reveal official mark-scheme answer Official mark-scheme answer for 2(B)

Official answer for Question 2

Part (b)

✓
One mark check, one mark matching description, max four

Question 4

✓
Check:
✓
validation
✓
// length check
✓
Description length check // checks number of characters in password
✓
Check:
✓
verification // double entry
✓
Description double entry // comparison that two inputs are the same

Mark scheme 0478_s22_ms_22.pdf →

Show text version of question

Question 2

Part (b)

Question 2

An algorithm allows a user to input their password and checks that there are at least eight

characters in the password. Then, the user is asked to re-input the password to check that both inputs are the same. The user is allowed three attempts at inputting a password of the correct length and a matching pair of passwords. The pre-defined function LEN(X) returns the number of characters in the string, X

01 Attempt 0 ← 02 REPEAT 03 PassCheck TRUE ← 04 OUTPUT "Please enter your password " 05 INPUT Password 06 IF LEN(Password) < 8 07 THEN 08 PassCheck TRUE ← 09 ELSE 10 OUTPUT "Please re-enter your password " 11 INPUT Password2 12 IF Password <> Password 13 THEN 14 PassCheck FALSE ← 15 ENDIF 16 ENDIF 17 Attempt ← Attempt + 1 18 UNTIL PassCheck OR Attempt <> 3 19 IF PassCheck 20 THEN 21 OUTPUT "Password success" 22 ELSE 23 OUTPUT "Password fail" 24 ENDIF

Part (b)

The algorithm includes two types of check on the data input.

Identify and describe each type of check.

Type of check 1 ........................................................................................................................

Description ................................................................................................................................

...................................................................................................................................................

Type of check 2 ........................................................................................................................

Description ................................................................................................................................

...................................................................................................................................................

[4]
Topic relevance

Why this question appears here

98% assigned-topic match · Algorithm design and problem-solving

Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.

Permanent source page: Educate A Change · From 0478_s22_qp_22.pdf

Keep practising this topic