AP CSA FRQ Guide
2022 FRQ 3: ReviewAnalysis
Write two methods for analyzing website reviews. The first computes the average rating from an array of Review objects. The second collects comments containing exclamation points, prefixes each with its index, and ensures the formatted comment ends with punctuation.
Skills Tested
What this FRQ is really practicing
Treat these skills as the study checklist. If any tag feels shaky, review that topic before attempting the full written response.
Starter Approach
How to begin without copying a solution
- 1Part A: traverse allReviews, add each Review rating, and return the average as a double.
- 2Part B: create a new ArrayList<String> for formatted comments.
- 3Include only comments that contain an exclamation point.
- 4Prefix each selected comment with its array index and a hyphen.
- 5If the original selected comment does not end with a period or exclamation point, add a period.
Write a first attempt before revealing any solution outline. Most AP CSA FRQ progress comes from tracing your own code and finding the missing case.
Common Mistakes
Mistakes to watch for while writing
Self Check
Review questions before you submit
Defines getAverageRating with double return type and no parameters.
Part A returns an arithmetic mean.
Traverses the allReviews array.
Use allReviews.length or an enhanced for loop.
Uses getRating for each review.
Ratings are accessed through the Review method.
Returns a double average rather than integer division.
Cast the sum or divisor to double.
Defines collectComments with ArrayList<String> return type.
Part B returns a list of formatted strings.
Creates a new ArrayList<String> result.
Do not modify allReviews.
Uses an index-based traversal for formatted prefixes.
The returned String begins with the review index.
Uses getComment to access each comment.
Comments are accessed through the Review method.
Practice Links
