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 | |
|---|---|---|
| 1dry run | AThe steps of a dry run should be recorded in a trace table, so that each variable value and OUTPUT is written down and can be checked | |
| 2Total ← 0 FOR Count ← 1 TO 3 Total ← Total + Count NEXT Count | BAverage ← Total * Count | |
| 3A dry run uses chosen test data as the inputs, so you pretend the user typed these values in | CA short algorithm you can dry run: Total goes 0, 1, 3, 6 as you follow each line in order and record the values | |
| 4A dry run can find a logic error, because the values you record show the algorithm giving a wrong result | DINPUT Number // test data: 7 | |
| 5Dry run: skip the loop lines and just write down the final OUTPUT | EA dry run must follow every line in order, so skipping the loop lines means that you miss the changing values and any errors | |
| 6Dry run: record the values in your head and do not use a trace table | FWorking through an algorithm by hand, line by line, with chosen input values, to see what it does without running it on a computer |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
dry run — Working through an algorithm by hand, line by line, using chosen test data as inputs and recording each step in a trace table, to see what it does and find logic errors without running it.// A dry run is done by handNum ← 5
Num ← Num * 2
OUTPUT NumIF Mark >= 50 THEN
OUTPUT "Pass"
ENDIFFOR Count ← 1 TO 3
OUTPUT Count
NEXT CountOUTPUT "Enter a number"
INPUT Num
OUTPUT Num * 2