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 | |
|---|---|---|
| 1score >= 50 | AColumns: x > 5 | y < 10 | x > 5 OR y < 10 | |
| 2age >= 13 AND hasPermission = TRUE | BA compound condition: check each part separately, then combine the results. It is TRUE only if both parts are TRUE. | |
| 3A condition column records TRUE or FALSE on every row, so you can see which path (THEN or ELSE) was taken and why. | CThe column holds the value 72 instead of TRUE or FALSE. A condition column should be headed score >= 50 and record TRUE. | |
| 4To trace a compound condition, add one column for each part and then one for the whole condition. | DIF temp > 30 THEN with a column headed: temp > 30 | |
| 5Column heading: score | Row entry: 72 (under the IF score >= 50 test) | Eage >= 13 is FALSE because 12 is less than 13. With AND, one FALSE part makes the whole condition FALSE, so the entry should be FALSE. | |
| 6Row: age = 12, column age >= 13 AND hasPermission = TRUE, entry TRUE (hasPermission is TRUE) | FA condition column heading: write TRUE or FALSE on each row to show whether the score passed the test. |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
condition column — A trace table column headed by a condition, such as age >= 13, that records TRUE or FALSE on each row so you can see which path the algorithm took and why.IF score > 50 THEN
score | score > 50 | OUTPUTIF age >= 13 THEN
age = 12 | age >= 13 | FALSEIF age >= 13 AND age <= 17 THEN
age | age >= 13 AND age <= 17 | OUTPUTIF age >= 13 AND age <= 17 THEN
20 | age >= 13: TRUE | age <= 17: FALSEIF day = "Sat" OR day = "Sun" THEN
Sat | TRUE | FALSE | TRUE