Computer Science · May / June 2021 · Paper 22 · Question 4
2210
As printed in the paper
The question as text
This algorithm checks passwords. • Each password must be 8 or more characters in length; the predefined function Length returns the number of characters. • Each password is entered twice, and the two entries must match. • Either Accept or Reject is output. • An input of 999 stops the process. 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
Read automatically from the paper; the printed page above is exact.
Show the answer and mark scheme
4(a)[3]
4(b)[4]
Make a free account to save your answers and see your weak topics and ask the AI why a wrong answer is wrong.

