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 | |
|---|---|---|
| 1CONSTANT Pi ← 3.142 | AThe second line tries to change the value of a constant, but a constant is set once and cannot change while the program runs. | |
| 2CONSTANT HourlyRate ← 12.50 | BCreates a named value Pi that is fixed at 3.142 and cannot change while the program runs | |
| 3A constant is set once before the program runs, so its value is written when it is named | CCONSTANT MaxScore ← 100 | |
| 4A variable can be given new values as the program runs, unlike a constant | DCreates a named pay rate of 12.50 that stays the same every time the program uses it | |
| 5CONSTANT Pi ← 3.142 Pi ← 3.14159 | EHourlyRate is meant to be fixed, but this declares it as a variable, so it could be changed later in the program. | |
| 6DECLARE HourlyRate : REAL HourlyRate ← 12.50 | FScore ← Score + 10 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
CONSTANT — A named value set once before the program runs that never changes, unlike a variable. Example: CONSTANT Pi ← 3.142 or CONSTANT HourlyRate ← 12.50 are fixed while the program runs.CONSTANT Pi ← 3.142CONSTANT HourlyRate ← 12.50CONSTANT Pi ← 3.142CONSTANT HourlyRate ← 12.50
Pay ← Hours * HourlyRateCONSTANT Pi ← 3.142
Area ← Pi * Radius ^ 2