Question 4(a) 2021 · May-June · Paper 22 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 4
Part (a)
Question 3
Show text version of question
Question 4
Part (a)
Question 4
This algorithm checks passwords.
- Each password must be 8 or more characters in length; the predefined function Length
- Each password is entered twice, and the two entries must match.
- Either Accept or Reject is output.
- An input of 999 stops the process.
returns the number of characters.
REPEAT OUTPUT "Please enter password" INPUT Password IF Length(Password) >= 8 THEN INPUT PasswordRepeat IF Password <> PasswordRepeat THEN OUTPUT "Reject" ELSE OUTPUT "Accept" ENDIF ELSE OUTPUT "Reject" ENDIF UNTIL Password = 999
Part (a)
Complete the trace table for the algorithm using this input data:
Secret, Secret, VerySecret, VerySecret, Pa55word, Pa55word, 999, 888
Password PasswordRepeat OUTPUT
Question 11
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 2210_s21_qp_22.pdf
