Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1UNTIL Password1 = Password2 | AREPEAT INPUT Password1 INPUT Password2 UNTIL Password1 = Password2 | |
| 2OUTPUT "Passwords do not match" | BThe loop repeats until the two typed values are equal, so the double entry check passes | |
| 3A double entry check asks for the same value twice using two INPUT statements | CTells the user the two entries were different so they must type them again | |
| 4The two entries are compared inside a REPEAT loop that only ends when they are equal | DThe condition uses <> so the loop stops when the entries are different. It should use = so it stops only when they match. | |
| 5UNTIL Password1 <> Password2 | EINPUT Password1 INPUT Password2 | |
| 6REPEAT INPUT Password1 UNTIL Password1 = Password1 | FThere is only one INPUT and the variable is compared with itself, so it is always true. There must be a second INPUT into Password2 and the condition must compare Password1 = Password2. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
UNTIL Password1 = Password2 — Double entry check: INPUT the value twice inside a REPEAT loop and stop only when both are equal. Output a message if they do not match, so typing mistakes are caught.REPEAT
INPUT Password1
INPUT Password2 INPUT Password2
UNTIL Password1 = Password2UNTIL Password1 = Password2IF Password1 <> Password2 THEN
OUTPUT "Passwords do not match"
ENDIFIF Password1 <> Password2 THEN
OUTPUT "Passwords do not match"
ENDIF