Ap Csa 2019 Frq 3 Delimiters
AP CSA 2019 FRQ 3: Delimiters
Complete solution, scoring rubric, and walkthrough — verified from the official College Board PDF
| Question Type | ArrayList |
| Skills Tested | ArrayList building from array, two-condition balance algorithm, running count tracking |
| Difficulty | Medium-Hard |
| Recommended Time | 22 minutes |
What This Problem Asks
2019 AP CSA FRQ 3 Delimiters asks students to write two methods. getDelimitersList filters a String array to keep only the open and close delimiter tokens. isBalanced implements a two-condition balance check: close count must never exceed open count during traversal, AND total open must equal total close at the end.
What This FRQ Tests
This FRQ tests Unit 4: ArrayList (building with add) and Unit 2 (conditionals, running count, early return).
Official Question & PDF
PDF cannot display on this device. Open PDF directly →
Provided Code
public class Delimiters
{
private String openDel;
private String closeDel;
public Delimiters(String open, String close) {
openDel = open; closeDel = close;
}
/** Returns ArrayList of only the delimiter tokens (openDel or closeDel) from tokens array. */
public ArrayList getDelimitersList(String[] tokens) {
/* part (a) */
}
/** Returns true if delimiters are balanced (no excess close before open; equal counts at end). */
public boolean isBalanced(ArrayList delimiters) {
/* part (b) */
}
}
Part A — 4 Points
Write getDelimitersList: loop through tokens, add each token that equals openDel or closeDel to the result ArrayList, and return it.
Write Your Solution
Scoring Rubric (Part A — 4 points)
| +1 | Traverses the tokens array |
| +1 | Compares each token to openDel and closeDel using equals
|
| +1 | Adds matching tokens to the result ArrayList |
| +1 | Returns the correct ArrayList in original order (algorithm) |
Solution
public ArrayListgetDelimitersList(String[] tokens) { ArrayList result = new ArrayList (); for (String token : tokens) { if (token.equals(openDel) || token.equals(closeDel)) { result.add(token); } } return result; }
Part B — 5 Points
Write isBalanced: return true if (1) at no point do close delimiters exceed open delimiters in count, AND (2) the total open count equals total close count.
Write Your Solution
Scoring Rubric (Part B — 5 points)
| +1 | Traverses the delimiters ArrayList |
| +1 | Counts open vs. close delimiters |
| +1 | Checks condition 1: close count never exceeds open count during traversal |
| +1 | Checks condition 2: total open equals total close at end |
| +1 | Returns correct boolean in all cases (algorithm) |
Solution
public boolean isBalanced(ArrayListdelimiters) { int openCount = 0; int closeCount = 0; for (String d : delimiters) { if (d.equals(openDel)) { openCount++; } else { closeCount++; } if (closeCount > openCount) { return false; } } return openCount == closeCount; }
Common Mistakes to Avoid
It's not enough to check that open count equals close count at the end. You must also check that close count never exceeds open count DURING traversal.
Wrong (misses condition 1)
return openCount == closeCount; // passes for " " incorrectly!
Correct
if (closeCount > openCount) {
return false; // condition 1 inside loop
}
return openCount == closeCount; // condition 2 after loop
Exam Tips
Scoring Summary
| Part | Method | Points |
|---|---|---|
| Part A | Write |
4 |
| Part B | Write |
5 |
| Total | 9 |
Want the Complete 2019 FRQ Solutions?
Browse all past AP CSA FRQs with full solutions and scoring breakdowns.
Related FRQs
ArrayList 2023 FRQ 3: WeatherData — ArrayList cleaning and heat wave detection ArrayList 2021 FRQ 3: ClubMembers — ArrayList add and backward removalStudy the Concepts
Struggling with FRQs? Get 1-on-1 Help
Work directly with Tanner — AP CS teacher with 11+ years experience and 1,845+ verified tutoring hours. 54.5% of students score 5s (vs. 25.5% national average).
5-session packages at $125/hr. Venmo, Zelle, PayPal, or credit card.
Frequently Asked Questions
What does 2019 AP CSA FRQ 3 Delimiters test?
FRQ 3 tests ArrayList building from a String array (getDelimitersList) and a two-condition balance check algorithm (isBalanced): close count never exceeds open count during traversal, AND total open equals total close.
How many points is FRQ 3 worth?
9 points: 4 for Part A (getDelimitersList) and 5 for Part B (isBalanced).
What are the two conditions for isBalanced?
Condition 1: at no point during traversal can the close count exceed the open count. Condition 2: at the end, total open must equal total close. Both must hold for balanced.
Can I use openCount - closeCount >= 0 instead?
Yes. Checking closeCount > openCount is equivalent to checking openCount - closeCount < 0. Either approach earns the rubric point.
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]