AP CSA FRQ summary
Here are the example questions for each of the four Free - Response Questions (FRQ) in the AP CSA exam, along with the corresponding content descriptions:
Question 1: Methods and Control Structures
- Question: Write a method
countVowelsin a classStringUtilsthat takes a string as a parameter and returns the number of vowels (a, e, i, o, u) in the string. The method should be case - insensitive, meaning it should count both uppercase and lowercase vowels. - Sample Solution:
public class StringUtils {
public static int countVowels(String str) {
int count = 0;
str = str.toLowerCase();
for (int i = 0; i < str.length(); i++) {
char ch = str.charAt(i);
if (ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u') {
count++;
}
}
return count;
}
}
Question 2: Classes
- Question: Design a class
Rectanglewith private instance variableslengthandwidth. Include a constructor that takes the length and width as parameters, and methods to calculate the area and perimeter of the rectangle. Also, provide a method to display the rectangle's dimensions and its area and perimeter. - Sample Solution:
public class Rectangle {
private double length;
private double width;
public Rectangle(double length, double width) {
this.length = length;
this.width = width;
}
public double getArea() {
return length * width;
}
public double getPerimeter() {
return 2 * (length + width);
}
public void displayInfo() {
System.out.println("Length: " + length + ", Width: " + width);
System.out.println("Area: " + getArea() + ", Perimeter: " + getPerimeter());
}
}
Question 3: Arrays / ArrayLists (From 2026, focus on ArrayList)
- Question: Write a method
averageArrayListthat takes anArrayList<Integer>as a parameter and returns the average of the numbers in the list. - Sample Solution:
import java.util.ArrayList;
public class ArrayListUtils {
public static double averageArrayList(ArrayList<Integer> list) {
int sum = 0;
for (Integer num : list) {
sum += num;
}
return (double) sum / list.size();
}
}
Question 4: Two - Dimensional Arrays
- Question: Write a method
sumDiagonalthat takes a two - dimensional integer array (square matrix) as a parameter and returns the sum of the elements on the main diagonal (from the top - left to the bottom - right). - Sample Solution:
public class TwoDArrayUtils {
public static int sumDiagonal(int[][] matrix) {
int sum = 0;
for (int i = 0; i < matrix.length; i++) {
sum += matrix[i][i];
}
return sum;
}
}
From 2026, after the adjustment of the AP CSA exam syllabus, the number of FRQ questions remains 4, but the total score is reduced from 36 points to 25 points. In addition, the updated course and exam will pay more attention to students' understanding and application ability of core concepts, and reduce the examination of complex concepts, so that students can more systematically master the basic knowledge of computer science.

浙公网安备 33010602011771号