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.
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
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.
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.
books = [["North", "Ali", 120], ["West", "Bea", 90], ["South", "Ali", 150]]target = "Ali"match_count = 0total_pages = 0for row in books:if row[1] == target:match_count = match_count + 1total_pages = total_pages + row[2]print(match_count)print(total_pages)
| Row | books | target | match_count | total_pages | row | row[1] == target | Output |
|---|---|---|---|---|---|---|---|
| 1 | |||||||
| 2 | |||||||
| 3 | |||||||
| 4 | |||||||
| 5 | |||||||
| 6 | |||||||
| 7 |
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.
books = [["North", "Ali", 120], ["West", "Bea", 90], ["South", "Ali", 150]]
# Define author_total, call it for Ali and format the result.
A student uses if row[0] == target:. State the correction.
Use the given record schema.
Students type their answer here.
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.
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
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.