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!
החלק בתשובה פתוחה
- מבחן AP CSA כולל שני חלקים. חלק 1 הוא בחירה מרובה. חלק 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.
סוג 1: מתודות ומבני בקרה
- אתה כותב מתודה אחת או שתיים באמצעות לולאות,
if, וחשבון פשוט עלint,double,booleanוString. - אין צורך לעצב מחלקה — המערכת נותנת אותך. פשוט מלא את גוף המתודה.
- זו השאלה ה"קודנית ביותר". שיעורים 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.
סוג 2: עיצוב מחלקה
- נתונה לך תיאור של מחלקה ועליך לכתוב את כל המחלקה.
- משמעות הדבר: משתנים אינסטנציאליים, בונה (constructor), והמתודות שהן מבקשות.
- זכור
privateשדות, הבונה עם שם זהה למחלקה, וthis.field = field. שיעור 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.
סוג 3: מערך / ArrayList
- אתה עובד עם
ArrayList(או לעיתים קרובות עם מערך) וכותב קוד שיסרוג אותו. - משימות נפוצות: למצוא ערך, לספור פריטים, להסיר פריטים או לבנות רשימה חדשה.
- שמור היטב על האינדקס כאשר אתה מסיר תוך כדי לולאה. שיעורים 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.
סוג 4: מערך 2-ממדי
- אתם עובדים עם מערך 2-ממדי (גריד של שורות ועמודות).
- אתה משתמש בלולאות מקוננות: לולאה חיצונית לשורות ולולאה פנימית לעמודות.
- משימות נפוצות: לחבר שורה, לחבר עמודה, למצוא את הערך הגדול ביותר או לספור התאמות. שיעור 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()); בדוק את הקצוות. - השתמש ב
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.
- כל הכישורים שאתה צריך לסוגים FRQ האלה נמצאים בשיעורים 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.
כעת תנסו בעצמכם
- נסה לכתוב מטודה בסגנון FRQ בעצמך — אותו צורה כמו בסוג 1 למעלה.
- לחץ על בדוק תשובה כדי להרכיב ולהריץ אותה על השרת.
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 (גדולים או שווים). השתמש בלופ וב-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: אחסן width ו-height מהקונסטרוקטור, והשלם את area() כך שיהחזיר רוחב × גובה. זה בדיוק מה ששאלת FRQ מסוג 2 דורשת.
Click Run to see the output here. · לחץ על הרץ כדי לראות את התוצא כאן.