An algorithm has been written in pseudocode to check if a new password is in a list of previously used passwords OldList[] If the password is not found, the new password will be stored at the end of the list to replace "XXXX" already stored there. 01 OUTPUT "Enter your new password " 02 INPUT NewPassword 03 Posn ← 1 04 Found ← FALSE 05 REPEAT 06 IF Password = OldList[Posn] 07 THEN 08 Found ← TRUE 09 ELSE Posn ← Posn + 1 10 ENDIF 11 UNTIL Found AND OldList[Posn] = "XXXX" 12 IF Found 13 THEN 14 OUTPUT "Password has been used before" 15 ELSE 16 INPUT "New password accepted" 17 OldList[Posn] ← NewPassword 18 ENDIF
- (a)Identify the three errors in the pseudocode and suggest corrections. Error 1 Correction Error 2 Correction Error 3 Correction[3]
- (b)Complete this flowchart for the corrected algorithm: START STOP[6]
Mark scheme
Marking points from the official mark scheme (Oct/Nov 2023). The mark or mark type is shown in brackets.
- [3] One mark for each error identified and correction given Line 06 Password should be NewPassword Line 11 AND should be OR Line 16 INPUT should be OUTPUT
- [6] Max six marks from: Max four from: one mark for data entry with message one mark for initialisation one mark for checking list // decision box comparing input with array one mark for updating // updating the two variables position and found one mark for loop control // second decision box one mark for setting new password to position in list one mark for outputs // two outputs Two marks: one mark for correct use of flow chart symbols one mark for correct use arrows and labels
Write your answer and get it marked
On Oracle Prep you can write or photograph your own answer and have it marked by AI against this mark scheme, with feedback on what you missed.
Sign up free →