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 | |
|---|---|---|
| 1RANDOM() | AValue ← RANDOM() | |
| 2Num ← RANDOM() | BDECLARE Chance : REAL | |
| 3RANDOM takes no arguments, so its brackets are left empty when it is called | CA library routine that returns a random REAL number between 0 and 1 inclusive, using empty brackets | |
| 4The result of RANDOM is a REAL number, so the variable that stores it should be declared as REAL | DRANDOM takes no arguments, so a value must not be put inside the brackets. It should be RANDOM(). | |
| 5Num ← RANDOM(10) | EThe brackets are missing. RANDOM is a routine, so it must be called with empty brackets: RANDOM(). | |
| 6Num ← RANDOM | FCalls RANDOM and stores the returned random REAL value in the variable Num |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
RANDOM() — A library routine with empty brackets that returns a random REAL number from 0 to 1 inclusive, a different value each time it is called. Store it, e.g. Num ← RANDOM()Num ← RANDOM()DECLARE Num : REAL
Num ← RANDOM()
OUTPUT NumValue ← RANDOM()
OUTPUT ValueNum ← RANDOM()DECLARE Chance : REAL
Chance ← RANDOM()
OUTPUT Chance