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
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
Program: A Student Grade Tracker that calculates a weighted quiz average and identifies the lowest score.
Must include: named procedure, parameter(s), and an algorithm with sequencing, selection, and iteration
A call to the procedure above, used to accomplish the program's purpose
Shows data being assigned/stored into the list
The same list accessed and processed to accomplish something meaningful
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.
Program Design, Function, and Purpose
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.
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.
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
Procedure, Iteration, and Algorithm Design
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.
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.
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.
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.
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.
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.”
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
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.
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.
Prefer email? Reach me directly at [email protected]