AP CSP Practice Exam 1 Written Response

AP CSP Practice Exam 1 — Written Response

Section II • 2 Questions • Time: 1 Hour • Mirrors 2024 AP Exam Format

📋 CSP Reference Sheet Exam 1 — Written Response (Section II) ← Back to MCQ Section (70 Questions)

Section II Directions

Read each question carefully and completely. This section mirrors the 2024 AP CSP Section II format.

  • Question 1 (standalone — no PPR): Describe your program's design, function, or purpose
  • Question 2 (3 parts, a/b/c): Refer to your Personalized Project Reference (PPR) for all parts
  • Write your answers in the text boxes, then click Show Sample Response to compare
  • Use the toggle below to practice with the provided sample PPR, or switch to use your own Create Task project code
Personalized Project Reference (PPR)
About this PPR: On the real AP exam, your PPR is a printed document of screenshots from your own Create Task program. The four code segments below mirror the exact structure College Board requires. Use this sample to practice, or click the toggle above to use your own project instead.

Program: A Student Grade Tracker that calculates a weighted quiz average and identifies the lowest score.

PROCEDURE — Part (i)   Procedure Definition

Must include: named procedure, parameter(s), and an algorithm with sequencing, selection, and iteration

PROCEDURE calculateWeightedAverage(scoreList, weightList) { total 0 weightSum 0 FOR EACH i IN [1, 2, 3, 4, 5] { total total + (scoreList[i] * weightList[i]) weightSum weightSum + weightList[i] } IF (weightSum = 0) { RETURN(0) } RETURN(total / weightSum) }
PROCEDURE — Part (ii)   Procedure Call

A call to the procedure above, used to accomplish the program's purpose

scores [88, 72, 95, 61, 84] weights [1, 1, 2, 1, 2] avg calculateWeightedAverage(scores, weights) DISPLAY("Weighted Average: ") DISPLAY(avg)
LIST — Part (i)   How data is stored in the list

Shows data being assigned/stored into the list

scores [88, 72, 95, 61, 84]
LIST — Part (ii)   How the list is used to fulfill the program's purpose

The same list accessed and processed to accomplish something meaningful

lowest scores[1] FOR EACH val IN scores { IF (val < lowest) { lowest val } } DISPLAY("Lowest score: ") DISPLAY(lowest)

Using Your Own PPR

Have your printed or digital PPR open alongside this page. Your PPR must contain these four code segments:

  • Procedure (i): Your student-developed procedure with sequencing, selection, and iteration
  • Procedure (ii): A call to that procedure within your program
  • List (i): Code showing how data is stored into your list
  • List (ii): Code showing that same list being used to fulfill your program's purpose

All questions in Question 2 refer to your procedure and list. Sample responses below describe what to address rather than specific answers, since your code is unique.

Question 1 No PPR needed

Program Design, Function, and Purpose

Programs accept input to achieve their intended functionality. Describe at least one valid input to your program and what your program does with that input.
Your Response:

Describe: (1) a specific valid input your program accepts, (2) how or where the input is received, and (3) what your program does with it to produce output or accomplish its purpose.

Rubric: You need a specific input AND an explanation of what the program does with it. Vague answers (“the user enters data and the program processes it”) earn no credit. Name the input, name what the program does, name the output.

Sample Full-Credit Response (based on the sample PPR program):

A valid input to the Grade Tracker program is a list of five integer quiz scores, for example [88, 72, 95, 61, 84]. The user provides these scores at the start of the program and they are stored in a list called scores. The program uses this input in two ways: first, it passes the scores list and a weights list to the calculateWeightedAverage procedure, which multiplies each score by its corresponding weight and returns the weighted average for display. Second, it iterates through the scores list to find and display the lowest individual quiz score.

Using your own PPR? Describe one specific input your program accepts (user click, number typed, file read, etc.), name the variable that stores it, and explain what your program computes or displays as a result.

Struggling with the Written Response? Get 1-on-1 Help.

11+ years of AP CS teaching experience • 1,845+ tutoring hours • 451 five-star reviews • $125/hr packages

Book a Session →
Question 2 Refer to your PPR for all parts

Procedure, Iteration, and Algorithm Design

Refer to your Personalized Project Reference when answering this question. Answer all three parts: (a), (b), and (c).
(a) Iteration Statement

Consider the first iteration statement included in the Procedure section (i) of your PPR. Describe what is being accomplished by the code in the body of the iteration statement.

Rubric: Do not just say “the loop repeats through the list.” Describe what the body executes on each iteration and what the loop has accomplished after all iterations complete. Be specific about variable names and what values they hold.

Sample Full-Credit Response (sample PPR — procedure: calculateWeightedAverage):

The FOR EACH loop iterates over the list [1, 2, 3, 4, 5], using each value as an index i. On each pass, the body executes two assignments: it adds scoreList[i] * weightList[i] to the running total, and adds weightList[i] to the running weightSum. After all five iterations complete, total holds the sum of all weighted scores (519 for the sample data) and weightSum holds the total weight (7), which are the two values needed to compute the weighted average outside the loop.

Using your own PPR? Find the FOR EACH or REPEAT loop in your procedure. Describe what one pass does, then what all passes together accomplish.
(b) Two Calls That Cause Different Code Segments to Execute

Consider the procedure in Procedure section (i) of your PPR. Write two calls to your procedure that each cause a different code segment in the procedure to execute. Describe the expected behavior of each call.

If it is not possible for two calls to cause different code segments to execute, explain why this is the case for your procedure.

Rubric: “Different code segment” means a different branch runs — e.g., the IF executes in one call but the ELSE executes in the other. Both calls must use valid argument types. Explain what specifically causes each path to execute.

Sample Full-Credit Response (sample PPR):

Call 1: calculateWeightedAverage([88, 72, 95, 61, 84], [1, 1, 2, 1, 2])
The weights sum to 7, so weightSum is 7 after the loop. The condition weightSum = 0 evaluates to false, so the IF block is skipped and the procedure executes RETURN(total / weightSum), returning approximately 74.1.

Call 2: calculateWeightedAverage([90, 85, 78, 92, 88], [0, 0, 0, 0, 0])
All weights are 0, so weightSum = 0 after the loop. The condition weightSum = 0 evaluates to true, causing the different code segment RETURN(0) inside the IF block to execute instead, preventing a divide-by-zero error.

Using your own PPR? Identify your IF/ELSE or conditional. Write one call where the condition is true and one where it's false, explaining why each triggers that path.
(c) Algorithm Using a Provided Procedure

Suppose another programmer gives you a procedure called checkValidity(value) that returns true if the value is valid and false otherwise.

Using the list identified in the List section of your PPR, explain in detailed steps an algorithm that uses checkValidity to determine whether all elements in your list are valid. Your explanation must be detailed enough for someone else to write the program code from your description alone.

Rubric: “Loop through the list and check each one” is too vague for credit. You must describe: (1) initializing a tracking variable, (2) how to iterate through the list, (3) calling checkValidity on each element, (4) what to do when it returns false, and (5) the final output. A grader must be able to write the code from your words alone.

Sample Full-Credit Response (sample PPR — list: scores):

Step 1: Initialize a Boolean variable allValid to true before the loop begins.

Step 2: Use a FOR EACH loop to iterate through every element in the scores list one at a time, assigning each element to a temporary variable called val.

Step 3: Inside the loop body, call checkValidity(val). If it returns false, set allValid to false.

Step 4: Do not stop the loop early — continue iterating through all remaining elements so that every element in scores is checked by checkValidity.

Step 5: After the loop finishes, check allValid. If it is true, display “All scores are valid.” If it is false, display “One or more scores failed the validity check.”

Using your own PPR? Substitute your list's name for scores and val. The five-step structure above works for any list.

Want a Higher Score on the Real Exam?

54.5% of my AP CSA students score 5s — more than double the national average. Personalized tutoring makes the difference.

$150/hr single session • $125/hr with a 5-session package • Venmo, Zelle, PayPal, or card

← MCQ Section Exam 1 — 70 MCQ + Written Response Complete AP CSP Resources →

Get in Touch

Whether you're a student, parent, or teacher — I'd love to hear from you.

Just want free AP CS resources?

Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.

Typically responds within 24 hours

Message Sent!

Thanks for reaching out. I'll get back to you within 24 hours.

🏫 Welcome, fellow educator!

I offer curriculum resources, practice materials, and study guides designed for AP CS teachers. Let me know what you're looking for — whether it's classroom materials, a guest speaker, or Teachers Pay Teachers resources.

Email

[email protected]

📚

Courses

AP CSA, CSP, & Cybersecurity

Response Time

Within 24 hours

Prefer email? Reach me directly at [email protected]