Ap Csa 2021 Frq 3 Clubmembers

FRQ Archive2021 FRQs › FRQ 3: ClubMembers
2021 AP CSA • ArrayList

AP CSA 2021 FRQ 3: ClubMembers

Complete solution, scoring rubric, and walkthrough — verified from the official College Board PDF

9 Points Medium Unit 4
Question Type ArrayList
Skills Tested ArrayList add/remove, backwards traversal for safe removal, conditional filtering with two separate criteria
Difficulty Medium
Recommended Time 22 minutes

What This Problem Asks

2021 AP CSA FRQ 3 ClubMembers asks students to write two ArrayList methods. addMembers takes an array of names and adds each as a new MemberInfo object with the given graduation year and true (good standing). removeMembers traverses backwards, removes all members whose graduation year <= the parameter, and returns a list of those who were also in good standing.

What This FRQ Tests

This FRQ tests Unit 4: ArrayList (add, remove, backwards traversal) and Unit 2 (conditionals, loops).

Official Question & PDF

Download Full FRQ PDF →

PDF cannot display on this device. Open PDF directly →

Timer 22:00

Provided Code

public class MemberInfo
{
    public MemberInfo(String name, int gradYear, boolean hasGoodStanding) { /* not shown */ }
    public int getGradYear() { /* not shown */ }
    public boolean inGoodStanding() { /* not shown */ }
}

public class ClubMembers
{
    private ArrayList memberList;
    /** Adds new members with given graduation year, all initially in good standing. */
    public void addMembers(String[] names, int gradYear) { /* to be implemented in part (a) */ }
    /** Returns list of graduated members in good standing; removes ALL graduated members. */
    public ArrayList removeMembers(int year) { /* to be implemented in part (b) */ }
}

Part A — 4 Points

Write addMembers, which adds a new MemberInfo for each name in names to memberList, using gradYear and true (initially in good standing). Names can be added in any order.

Write Your Solution

Drag corner to expand ▽

 

Scoring Rubric (Part A — 4 points)

+1 Traverses the names array
+1 Creates a MemberInfo object for each name with gradYear and true
+1 Adds each MemberInfo to memberList
+1 All new members added with correct graduation year and good standing (algorithm)

Solution

public void addMembers(String[] names, int gradYear)
{
    for (String name : names)
    {
        memberList.add(new MemberInfo(name, gradYear, true));
    }
}

Part B — 5 Points

Write removeMembers: remove all members with gradYear <= year from memberList; return an ArrayList of those who were also inGoodStanding().

Write Your Solution

Drag corner to expand ▽

 

Scoring Rubric (Part B — 5 points)

+1 Traverses memberList (backwards or using index carefully)
+1 Calls getGradYear and compares to year
+1 Calls inGoodStanding and adds qualifying members to result list
+1 Removes graduated members (regardless of standing) from memberList
+1 Returns correct result list with no skipped elements (algorithm)

Solution

public ArrayList removeMembers(int year)
{
    ArrayList graduated = new ArrayList();
    for (int i = memberList.size() - 1; i >= 0; i--)
    {
        MemberInfo m = memberList.get(i);
        if (m.getGradYear() <= year)
        {
            if (m.inGoodStanding())
            {
                graduated.add(m);
            }
            memberList.remove(i);
        }
    }
    return graduated;
}
Two separate actions: For graduated members (gradYear <= year): (1) if in good standing, add to result; (2) ALWAYS remove from memberList. Use backwards traversal to avoid skipping elements after removal.

Common Mistakes to Avoid

Forward traversal when removing causes skipped elements

Wrong

for (int i = 0; i < memberList.size(); i++) {
    if (memberList.get(i).getGradYear() <= year) {
        memberList.remove(i);  // next element shifts to i, gets skipped!
    }
}

Correct (backwards)

for (int i = memberList.size() - 1; i >= 0; i--) {
    memberList.remove(i);  // elements to the right of i, not yet checked
}
Only removing members who are in good standing

ALL graduated members must be removed, regardless of standing. Only the return list is filtered by good standing.

Exam Tips

Backwards traversal for safe ArrayList removal: loop from size()-1 down to 0.
Remember: REMOVE all graduated members. RETURN only the graduated ones in good standing. These are two separate actions for the same condition (gradYear <= year).

Scoring Summary

Part Method Points
Part A Write 4
Part B Write 5
Total 9

Want the Complete 2021 FRQ Solutions?

Browse all past AP CSA FRQs with full solutions and scoring breakdowns.

FRQ Archive →

Related FRQs

ArrayList 2023 FRQ 3: WeatherData — cleanData backward traversal and longest heat wave ArrayList 2022 FRQ 3: ReviewAnalysis — Array average and formatted ArrayList building

Study the Concepts

Unit 4 Study Guide →

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.0Rating (451+ reviews)
1,845+Verified Hours
54.5%Score 5s

Book a Session ($150/hr) →

5-session packages at $125/hr. Venmo, Zelle, PayPal, or credit card.

Frequently Asked Questions

What does 2021 AP CSA FRQ 3 ClubMembers test?

FRQ 3 tests ArrayList operations. addMembers loops through a String array and adds MemberInfo objects. removeMembers traverses backwards (to avoid skipping), conditionally adds graduated-good-standing members to a return list, and always removes graduated members.

How many points is FRQ 3 worth?

9 points: 4 for Part A (addMembers) and 5 for Part B (removeMembers).

Why traverse backwards in removeMembers?

When you remove an element from an ArrayList at index i, all subsequent elements shift left. If you traverse forward and remove, you skip the next element. Traversing backwards avoids this issue.

What's the difference between the return list and the removal condition?

ALL graduated members (gradYear <= year) are removed from memberList regardless of standing. Only graduated members who are ALSO in good standing are added to the returned list.

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]