By LearnAllStudents Editorial Team. Source check dates are listed below.
Use the official course page
College Board’s AP Students page identifies course content and links to examination and performance-task information. Check the version and requirements relevant to your administration. Do not assume an IGCSE or GCSE programming paper has identical conventions, submission rules or permitted assistance.
An original algorithm trace
Set count to 0. For each value in [2, 7, 4, 9], add 1 to count only when the value is greater than 5. The changing count is 0, 0, 1, 1, 2 as the initial state and each iteration are recorded. The final count is 2. This exercise checks selection inside iteration; it is not a Create task submission or a copied College Board item.
Try it yourself
- Trace the same plan for [6, 5, 8].
- What changes if the condition is ‘at least 5’?
- Explain why count is different from the sum of the matching values.
Answers: the final count is 2; it becomes 3; count tracks how many values match, while summing their values would calculate something else. State the exact comparison operator before tracing.
Keep assessed work and practice separate
Read the official rules for assistance, attribution and submission with your teacher or coordinator. A worked example can support practice without becoming work to submit as your own. Confirm examination arrangements and deadlines through the current official sources. No named tutor’s AP coverage or place in an examination is promised here.
How a tutor would approach this
Bring the exact course task and assistance rules. Ask about the specific concept and confirm the course fit before arranging support.
Frequently asked questions
Is the tracing exercise an official AP item?
No. It is original practice.
Does a count equal the sum of selected values?
No. They calculate different quantities.
Can another board’s rules be substituted?
No. Follow the relevant AP administration’s official requirements.
Does this guide guarantee a tutor or exam place?
No. Confirm the actual arrangements separately.
Keep exploring your course
Continue in the Exam resources library
Choose another explanation and check your reasoning with its practice answers.
Official sources
- College Board: AP Computer Science Principles (checked 2026-11-23)
Related pages
Try a free 30-minute demo
Work through a question with a tutor. No payment needed.
Request a free 30-minute demo