FRQ workshop: the 4 question types · FRQ 워크숍: 4가지 유형
The free-response section
- The AP CSA exam has two parts. Part 1 is multiple choice. Part 2 is free response (you write Java by hand).
- There are always 4 free-response questions (FRQs), and they come in the same 4 types every year.
- This lesson is a quick map of the 4 types. Knowing the pattern makes the exam much less scary. You can do this!
프리 리스폰드 섹션 (Free-response section)
- AP CSA 시험은 두 부분으로 구성됩니다. Part 1은 객관식입니다. Part 2는 프리 리스폰드이며, 손으로 Java 코드를 작성합니다.
- 항상 **4개의 프리 리스폰드 문제(FRQs)**가 있으며, 매년 동일한 4가지 유형으로 출제됩니다.
- 이 레슨은 4가지 유형의 빠른 지도입니다. 패턴을 알면 시험이 훨씬 덜 무섭습니다. 당신은 할 수 있습니다!
Type 1: Methods and Control Structures
- You write one or two methods using loops,
if, and simple math onint,double,boolean, andString. - No class to design — the class is given. You just fill in the method body.
- This is the most "plain coding" question. Lessons 1–8 cover everything you need.
Type 1: 메소드 및 제어 구조
- 루프,
if, 그리고int,double,boolean,String에서의 간단한 수학을 사용하여 하나 또는 두 개의 메소드를 작성합니다. - 설계해야 할 클래스는 없습니다. 클래스가 이미 주어졌습니다. 메소드 바디만 채우면 됩니다.
- 가장 '순수한 코딩' 문제입니다. Lessons 1–8에서 필요한 모든 것을 다룹니다.
public class Grades {
// Count the scores that are 60 or more.
public static int countPassing(int[] scores) {
int count = 0;
for (int s : scores) {
if (s >= 60) {
count = count + 1;
}
}
return count;
}
public static void main(String[] args) {
int[] scores = {72, 40, 95, 60, 33};
System.out.println(countPassing(scores)); // 3
}
}
Type 2: Class Design
- You are given a description of a class and must write the whole class.
- That means: instance variables, a constructor, and the methods they ask for.
- Remember
privatefields, the constructor with the same name as the class, andthis.field = field. Lesson 6 covers this.
Type 2: 클래스 설계
- 클래스의 설명이 주어지며, 전체 클래스를 작성해야 합니다.
- 즉: 인스턴스 변수, 생성자, 그리고 그들이 요구하는 메소드입니다.
private필드, 클래스와 동일한 이름의 생성자, 그리고this.field = field을 기억하십시오. Lesson 6에서 다룹니다.
public class Student {
private String name;
private int score;
public Student(String name, int score) {
this.name = name;
this.score = score;
}
public int getScore() {
return score;
}
}
Type 3: Array / ArrayList
- You work with an
ArrayList(or sometimes an array) and write code that traverses it. - Common jobs: find a value, count items, remove items, or build a new list.
- Watch the index carefully when you remove while looping. Lessons 9–11 cover this.
Type 3: 배열 / ArrayList
ArrayList(또는 occasionally 배열)을 다루며 이를 **트래버스(traverses)**하는 코드를 작성합니다.- 일반적인 작업: 값 찾기, 항목 카운팅, 항목 제거, 또는 새 목록 생성.
- 루프하면서 제거할 때 인덱스를 주의 깊게 관리하십시오. Lessons 9–11에서 다룹니다.
// Count the Strings longer than 3 letters.
int count = 0;
for (int i = 0; i < words.size(); i++) {
if (words.get(i).length() > 3) {
count++;
}
}
return count;
Type 4: 2-D Array
- You work with a 2-D array (a grid of rows and columns).
- You use nested loops: an outer loop for rows, an inner loop for columns.
- Common jobs: sum a row, sum a column, find the largest value, or count matches. Lesson 12 covers this.
Type 4: 2-D 배열
- 2-D 배열(행과 열의 그리드)을 다루어 작업합니다.
- **중첩 루프(nested loops)**를 사용합니다: 행을 위한 외부 루프, 열을 위한 내부 루프.
- 일반적인 작업: 한 줄의 합계 계산, 한 열의 합계 계산, 최대 값 찾기, 또는 일치 항목 카운팅. Lesson 12에서 다룹니다.
// Add up every value in the grid.
int total = 0;
for (int r = 0; r < grid.length; r++) {
for (int c = 0; c < grid[r].length; c++) {
total += grid[r][c];
}
}
return total;
Exam strategy: read carefully
- Read the whole question first. Underline what the method must return and what its parameters are.
- Look at the example table they give. It shows exactly what your code should produce.
- Copy the method header they give you. Do not change its name, parameters, or return type.
시험 전략: 주의 깊게 읽기
- 문제 전체를 먼저 읽으십시오. 메소드가 무엇을 반환해야 하고 파라미터가 무엇인지를 선으로 그으십시오.
- 그들이 제공하는 예시 표를 보십시오. 이것이 당신의 코드가 정확히 생성해야 할 결과를 보여줍니다.
- 그들이给你的 메소드 헤더를 복사하십시오. 이름, 파라미터, 또는 반환 타입을 변경하지 마십시오.
Exam strategy: write methods that work
- Write the base of a loop first, then fill in the body. Get it running in your head step by step.
- Traverse correctly: start the index at
0, stop atlength(orsize()); check the edges. - Use
returnwith the right type. If the header saysint, return anint.
시험 전략: 작동하는 메소드 작성하기
- 먼저 루프의 기본 구조를 작성한 후 바디를 채우십시오. 단계별로 머릿속에서 실행되도록 검증하십시오.
- 올바르게 트래버스: 인덱스를
0에서 시작하고,length(또는size())에서 멈추십시오; 경계를 확인하십시오. - 올바른 type을 가진
return을 사용하십시오. 헤더에int이라고 되어 있다면,int를 반환하십시오.
Exam strategy: small wins add up
- You get points for parts that work, even if the whole method is not perfect. Always write something.
- Use only Java you know from this course. Simple, correct code beats clever code.
- Check your work with the example values from the question before you move on.
시험 전략: 작은 성공들이 쌓입니다
- 전체 메소드가 완벽하지 않더라도 작동하는 부분마다 점수를 받을 수 있습니다. 반드시 무언가를 작성하십시오.
- 이 과정에서 배운 Java만 사용하십시오. 단순하고 정확한 코드가 재치 있는 코드보다 낫습니다.
- 다음 단계로 넘어가기 전에 문제의 예시 값을 사용하여 작업을 확인하십시오.
You are ready
- The 4 types never change: methods, class design, array/ArrayList, and 2-D array.
- Every skill you need for these four FRQ types is in lessons 1–12. Practice each type a few times and the pattern becomes familiar.
- Stay calm, read carefully, and write the code you know. Good luck on the exam!
준비 완료
- 4가지 유형은 변하지 않습니다: 메소드, 클래스 설계, 배열/ArrayList, 그리고 2-D 배열.
- 이 네 가지 FRQ 유형에 필요한 모든 스킬이 Lessons 1–12에 있습니다. 각 유형을 몇 번 연습하면 패턴이 익숙해집니다.
- 차분하게, 주의 깊게 읽고, 아는 코드를 작성하십시오. 시험에 행운을 빕니다!
Common mistakes
- Match the method header exactly: the return type and the parameters.
- Read the whole prompt before you start coding.
흔한 실수
- 반환 타입과 파라미터를 정확히 맞춰 메소드 헤더를 일치시키십시오.
- 코딩을 시작하기 전에 전체 프롬프트를 읽으십시오.
Now you try
- Try one FRQ-style method yourself — the same shape as Type 1 above.
- Press Check answer to compile and run it on the server.
이제 직접 해보기
- 위 Type 1과 동일한 형태를 가진 FRQ 스타일의 메소드 하나를 직접 시도해 보십시오.
- Check answer를 눌러 서버에서 컴파일하고 실행하십시오.
FRQ practice — Type 1 (Methods). Complete countAtLeast(int[] scores, int limit) so it returns how many values in scores are at least limit (greater than or equal). Use a loop and an if, like the worked example above. · FRQ 연습 — 유형 1 (메서드). countAtLeast(int[] scores, int limit)을 완성하여 scores에서 최소 limit(이상이나 같음)인 값의 개수를 반환하도록 하십시오. 위의 worked example처럼 루프와 if을 사용하십시오.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.
FRQ practice — Type 2 (Class design). Complete the Rectangle class: store width and height from the constructor, and finish area() so it returns width × height. This is exactly what a Type 2 FRQ asks for. · FRQ 연습 — 유형 2 (클래스 설계). Rectangle class을 완성하십시오: constructor에서 width과 height을 저장하고, area()을 완료하여 width × height를 반환하도록 하십시오. 이는 정확히 Type 2 FRQ에서 요구하는 것입니다.
Click Run to see the output here. · 출력을 보려면 '실행'을 클릭하세요.