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) | ALeft ← MOD(17, 5) | |
| 2MOD(12, 4) | BThe comment is wrong: MOD gives the remainder, which is 1, not the whole-number part 3 (that is DIV). | |
| 3Check whether a whole number n is even by testing for a remainder of 0 when divided by 2 | CMOD is a function, so its two values must be in brackets: MOD(10, 3). | |
| 4Store the remainder of 17 divided by 5 in a variable called Left | DGives 1, because 10 divided by 3 is 3 with a remainder of 1 | |
| 5Rest ← MOD 10, 3 | EGives 0, because 4 divides into 12 exactly with nothing left over | |
| 6Answer ← MOD(10, 3) // gives 3 | FIF MOD(n, 2) = 0 THEN |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
MOD(10, 3) — MOD(a, b) gives the remainder when integer a is divided by integer b, so MOD(10, 3) is 1. A result of 0 means exact division. MOD(n, 2) is 0 for even n and 1 for odd n.Remainder ← MOD(10, 3)Rest ← MOD(10, 3)
OUTPUT RestIF MOD(Number, 2) = 0 THEN
OUTPUT "Even"
ENDIFIF MOD(Number, 2) = 1 THEN
OUTPUT "Odd"
ENDIFIF MOD(12, 4) = 0 THEN
OUTPUT "Divides exactly"
ENDIF