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 | |
|---|---|---|
| 1MOD(10, 3) | AChecks whether n is an even number | |
| 2IF MOD(n, 2) = 0 THEN | BMOD returns the remainder, not the whole-number quotient. MOD(10, 3) is 1. Use DIV(10, 3) to get 3. | |
| 3Find the remainder when 17 is divided by 5 | CGives 1, because 10 divided by 3 is 3 remainder 1 | |
| 4Test whether a whole number Num is odd | DMOD(17, 5) | |
| 5Answer ← MOD(10, 3) OUTPUT Answer // expects 3 | EA remainder of 1 means n is odd, not even. To test for even, the condition should be MOD(n, 2) = 0. | |
| 6IF MOD(n, 2) = 1 THEN OUTPUT "Even" ENDIF | FIF MOD(Num, 2) = 1 THEN |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
MOD(a, b) — Returns the remainder when a is divided by b. For example MOD(10, 3) gives 1. MOD(n, 2) = 0 means n is even.Remainder ← MOD(10, 3)IF MOD(Number, 2) = 0 THEN
OUTPUT "Even"
ENDIFIF MOD(Number, 2) <> 0 THEN
OUTPUT "Odd"
ENDIFDECLARE Remainder : INTEGER
Remainder ← MOD(10, 3)IF MOD(Number, 2) = 0 THEN
OUTPUT "Even"
ENDIF