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 HourlyRate ← 12.50 | AA constant must be given a literal value, not an expression that uses a variable. It should be written as CONSTANT HourlyRate ← 12.50. | |
| 2Seconds ← TotalSeconds MOD 60 | BSets a fixed pay rate at the top of the wage program. The value is a literal and cannot change while the program runs. | |
| 3Read the number of hours worked from the user into a declared variable | CWage ← HoursWorked * HourlyRate | |
| 4Process the input by working out the wage from the hours and the constant rate | DINPUT HoursWorked | |
| 5CONSTANT HourlyRate ← HoursWorked * 2 | EFinds the seconds left over after taking out whole minutes from a total number of seconds. | |
| 6Initial ← SUBSTRING(Name, 1, 3) | FA length of 3 returns three characters, not a single initial. The length should be 1: SUBSTRING(Name, 1, 1). |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
DECLARE INPUT OUTPUT — A complete program declares variables and a CONSTANT, reads values with INPUT, processes them with assignments, then shows results with OUTPUT, using meaningful names and // comments.// Rate never changes
CONSTANT HourlyRate ← 12.50DECLARE Hours : REAL
INPUT Hours// Calculate the wage
Wage ← Hours * HourlyRate
OUTPUT "Wage: ", WageMinutes ← TotalSeconds DIV 60
Seconds ← TotalSeconds MOD 60DECLARE Name : STRING
Initial ← SUBSTRING(Name, 1, 1)
OUTPUT Initial