Community resourceWorksheet

1CP2-CT-10.5 Final computational thinking and programming checkpoint

Part 5 of 5 · 1CP2-CT-10 · Integrated programming and data structures

This is the collection's Paper 2 transition. It samples two-dimensional data, subprogram interfaces, testing, tracing and correction. Read each requirement carefully; exact output and returned values are different demands.

Students will:

  • decompose an integrated programming requirement
  • trace two-dimensional data and subprogram state
  • design tests with explicit expected results
  • write and reason about a complete PLS-compatible solution

Inside: 3 explanation cells, 1 fill-in-the-blanks cell, 5 written answers, 1 trace table, 1 Python task and 1 multiple-choice question. 20 marks, about 45 minutes.

Series: 1CP2-CT-10 · Integrated programming and data structures, part 5 of 5.

Shared by Coding PathwayVerified teacher

  • 12 cells
  • About 45 minutes
  • CC BY-SA 4.0
  • Shared 17 Aug 2026

Preview

The whole resource, exactly as a class sees it. Answers and marking are held back.

Final computational-thinking and programming checkpoint

This is the collection's Paper 2 transition. It samples two-dimensional data, subprogram interfaces, testing, tracing and correction. Read each requirement carefully; exact output and returned values are different demands.

Fill in the blanks3 marks
In records[2][1], index 2 selects the gap 1 and index 1 selects its gap 2. A function sends reusable data back with gap 3.
  • field
  • return
  • row
Written answer2 marks

A program must load book records, find books by author and display matches. Give two suitable subprograms and state the input or output of each.

Choose from loading, searching and display.

Students type their answer here.

Trace table5 marks

Complete the trace table.

Record row, match_count and total_pages each iteration.

Use one row for each pass through the loop. Fill in a box only when that value changes on that row, and leave the rest blank.

ProgramPython
  1. books = [["North", "Ali", 120], ["West", "Bea", 90], ["South", "Ali", 150]]
  2. target = "Ali"
  3. match_count = 0
  4. total_pages = 0
  5. for row in books:
  6. if row[1] == target:
  7. match_count = match_count + 1
  8. total_pages = total_pages + row[2]
  9. print(match_count)
  10. print(total_pages)
Trace table with 7 columns
Rowbookstargetmatch_counttotal_pagesrowrow[1] == targetOutput
1
2
3
4
5
6
7
Written answer2 marks

Give a boundary and an erroneous test for a page-count field valid from 1 to 500 inclusive, with expected outcomes.

State exact inputs and accepted/rejected results.

Students type their answer here.

Substantial write task

Complete author_total(books, target) so it returns the total pages for every row whose author field 1 matches target. It must return 0 when no rows match. Call it for Ali, store the result in total, and print exactly Ali pages: 270.

Coding task8 marks
books = [["North", "Ali", 120], ["West", "Bea", 90], ["South", "Ali", 150]]
# Define author_total, call it for Ali and format the result.
Written answer1 mark

A student uses if row[0] == target:. State the correction.

Use the given record schema.

Students type their answer here.

Written answer2 marks

Explain why this function is fit for an absent author and give one test that proves it.

Connect initial value, no matches and returned result.

Students type their answer here.

Multiple choice1 mark

Why is result best kept local to author_total?

  • AEach call gets its own calculation state and the value leaves through return
  • BLocal variables are always global
  • CIt prevents parameters
  • DIt makes the file larger
Written answer1 mark

State one way to improve readability.

Name a concrete code feature.

Students type their answer here.

Route forward

Continue with timed full-IDE Amend and Write tasks and complete Paper 2 practice. This worksheet is a transition, not a substitute for the full two-hour onscreen examination.