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 | |
|---|---|---|
| 1INPUT Password1 INPUT Password2 | AOUTPUT "Passwords differ, try again" | |
| 2IF Password1 <> Password2 THEN | BChecks whether the two entries are different, which shows that a mistake was made. | |
| 3The entries must match, so the program accepts the data only when both entries are equal. | CUNTIL Password1 = Password2 | |
| 4When the two entries differ, the program asks the user to enter the data again. | DThe data is entered only once, so there is nothing to compare. This is not a double entry check. | |
| 5INPUT Password OUTPUT "Password accepted" | EMatching entries do not prove the data is correct. The same mistake made twice is not caught. | |
| 6Password1 = "cat12", Password2 = "cat12" Output: "Both entries are correct" | FThe same data is entered twice so that the two entries can be compared later. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
double entry check — Data is entered twice and the two entries are compared. Any difference shows a mistake, so the user must enter it again. It misses the same mistake made twice.INPUT Password1
INPUT Password2
IF Password1 = Password2 THENWHILE Password1 <> Password2 DO
INPUT Password2
ENDWHILEREPEAT
INPUT Password2
UNTIL Password1 = Password2IF Password1 <> Password2 THEN
OUTPUT "Passwords do not match"
ENDIFPassword1 ← "pasword"
Password2 ← "pasword"
Match ← Password1 = Password2