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 | |
|---|---|---|
| 1Name <> "" | AA presence check that is true only when Name has at least one character | |
| 2LENGTH(Name) > 0 | BIF LENGTH(Email) > 0 THEN | |
| 3A presence check makes sure a required field on a form is not left blank | CNo string can have a length less than 0, so this test is never true. A presence check needs LENGTH(Name) > 0. | |
| 4A presence check passes when the input is not empty | DThe condition is the wrong way round. It accepts an empty Name, so it does not check that something was entered. It should be Name <> "". | |
| 5IF Name = "" THEN OUTPUT "Accepted" | EWHILE Name = "" DO INPUT Name ENDWHILE | |
| 6IF LENGTH(Name) < 0 THEN | FA presence check that is true only when Name is not empty, so something has been entered |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
Presence check — A validation check that tests something has been entered, so the input is not empty. For example, Name <> "" or LENGTH(Name) > 0 makes sure a required field is not left blank.IF Name <> "" THEN
OUTPUT "Thank you"
ENDIFIF LENGTH(Name) > 0 THEN
OUTPUT "Thank you"
ENDIFIF LENGTH(Name) > 0 THEN
OUTPUT "Thank you"
ENDIFREPEAT
INPUT Name
UNTIL Name <> ""IF Name = "" THEN
OUTPUT "Name is required"
ENDIF