Skip to main content
AP CSP course

F13 · Topic 3.2 · 3.10

Club list filter

Filter a fictional capacity list while retaining duplicates and order, then explain why list abstraction avoids one code path per club.

1. Predict first

Predict the filtered list and its length for[2,7,3,7,0]with minimum 5.

Change it · step through · explain

Change an input, predict what will happen, then advance one step. Read why the state changes, reset and experiment. This fixed teaching model does not save progress or award XP.

Ready · Make a prediction

Ready to experiment
  1. Input 12,7,3,7,0Waiting
  2. Input 25Waiting

Ready to experiment

Why: Predict the first change, then advance one step.

Try this: Try repeated boundary values, no matches and an empty list.

2. Build your procedure

Write a parameterized full traversal that appends values at least minimum to a new list. State one-based index semantics if using positions, and compare with five separate variables.

Use AP CSP pseudocode, a language you know, or precise plain language. Your code is not executed here. Use the classroom assignment to save your response.

3. Check boundaries

Public worked tests for the fixed model
InputExpectedWhy this case
[2,7,3,7,0]; minimum 5[7,7]Keep duplicates and relative order.
[5,5]; minimum5[5,5]Inclusive boundary.
[]; minimum5[]Empty is a valid result, not an error.

4. Explain and reflect

If a filter returns only the first qualifying item, what test exposes the problem and what code placement causes it?

Model limits: A fixed inclusive filter. It does not execute student code or establish that every algorithm using a list is automatically correct or efficient.

Teacher guidance and scoring