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 | |
|---|---|---|
| 1for i from 1 to 30: input name | AA similar record structure: many records share the same fields, so one design can be reused | |
| 2record Student: name, year, house | Bwhile more items: input item | |
| 3Reusing one solution for similar tasks: the same check is needed on several inputs, so write it once as a function | CThe repeated input steps were written out one by one, so the pattern was missed. A loop should repeat one input step. | |
| 4Spotting a repeated data entry step: the same input and store steps happen for each item, so one loop covers them | Ddefine checkMark(mark) | |
| 5input name1 input name2 input name3 input name4 | EThe similar record structure was not recognised. One table design with the same fields can be reused for every class. | |
| 6Make a different table design for every class, even though each class list has the same fields | FA repeated data entry step: the same input action happens for every student, so one loop can be reused |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
pattern recognition — Spotting similarities or repeated features in sub-problems so that one solution can be reused for similar tasks, such as repeated data entry steps or similar record structures.for i from 1 to 30
input mark
total ← total + markdefine calcTotal(price, qty)
return price * qtydefine calcTotal(price, qty)
return price * qty
cost ← calcTotal(25, 2)while count < 10
input name
count ← count + 1for i from 1 to 5
input mark
total ← total + mark