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 | |
|---|---|---|
| 1// Add the mark to the total | AThe explanation has no // at the start, so it is not marked as a comment and looks like part of the code. It should be: Count ← Count + 1 // Add one to the count | |
| 2Total ← Total + Mark // running total | B// Check if the student passed IF Mark >= 50 THEN | |
| 3A comment that needs several lines must start each line with // | CThe comment on the second line is fine, but the last line ends with an empty //, which explains nothing. Also the comment lines should describe each statement. Remove the empty // or write a useful comment such as // Show the total | |
| 4A comment starts with // and explains the code without being part of the algorithm | DA short comment at the end of a line, explaining that statement without changing it | |
| 5Count ← Count + 1 Add one to the count | E// Calculate the average // of the three test marks | |
| 6// Read the mark // and add it to Total Input Mark Total ← Total + Mark OUTPUT Total // | FA comment on its own line above the code, explaining what the next statement does |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
// — Starts a comment that runs to the end of the line. It explains the code to the reader but is not part of the algorithm, so it is ignored when run.// Ask the user for their age
INPUT AgeTotal ← 0 // Start the total at zero// Add the three marks together
// then divide by three to find the mean
Average ← Total / 3// Repeat for each of the five students
FOR Count ← 1 TO 5
INPUT Mark
NEXT CountOUTPUT Total // Show the final total