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 | |
|---|---|---|
| 1ROUND(3.14159, 2) | ARoll ← ROUND(RANDOM() * 5, 0) + 1 | |
| 2LENGTH("Cambridge") | BMOD is missing its second value. A library routine such as MOD needs both values, for example 17 MOD 5, which gives 2. | |
| 3A library routine is called like a function, so its returned value can be stored in a variable | CA library routine call that returns 9, the number of characters in the string | |
| 4A library routine supplied with the language gives a random number without the programmer writing the code | DThe programmer wrote their own LENGTH routine and it does not work. LENGTH is already a library routine, so there is no need to write it. | |
| 5FUNCTION LENGTH(Word : STRING) RETURNS INTEGER RETURN 0 ENDFUNCTION | ETotal ← ROUND(Price * 1.2, 2) | |
| 6Answer ← 17 MOD | FA library routine call that returns 3.14, the number rounded to 2 decimal places |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
library routine — A ready-made subroutine supplied with the language that you can call without writing it, such as ROUND, RANDOM or LENGTH. It saves time and avoids errors.Result ← ROUND(3.14159, 2)OUTPUT LENGTH("Cloodit")Dice ← ROUND(RANDOM() * 6, 0)Remainder ← 17 MOD 5Whole ← 17 DIV 5