Topic: 2025FRQ真题详解
Questions:
Solutions:
1.官方解析
apcentral.collegeboard.org
2.其它解析
3.视频讲解

2025 AP CSA FRQ 1a
2025 AP Computer Science A FRQ 1A Review & Explanation Link to the released FRQs: https://apcentral.collegeboard.org/media/pdf/ap25-frq-computer-science-a.pdf Check out my channel page for playlists of past years' Reviews & Explanations Link to my solution webpage: https://sites.google.com/gilroyunified.org/computerscience/advanced-ap/frqs/2025/2025-1as Second video, as I made a big mistake not using "company." to call the helper methods in the first video I made for this. AP® is a trademark registered by the College Board, which is not affiliated with, and does not endorse, this content, which is intended for educational use by students.

2025 AP CSA FRQ Q1 Part a
🚀 AP CSA FRQ Breakdown Series 🚀 In this series, I walk you through step-by-step solutions to the official 2025 AP Computer Science A Free Response Questions — so you can master the structure, write clean code, and feel confident on test day. 🎯 Today’s Focus: Question 1, Part A We’ll break down exactly what the question is asking, plan the approach, and code it out together — the way the graders want to see it. 👉 Hit play to level up your FRQ game. #APCSA #APComputerScience #FRQ #Java #CollegeBoard #HighSchoolCoding

2025 AP Computer Science A FRQ
Every part of the 2025 AP Computer Science A FRQ is covered in this playlist.
第 1 页
DogWalkCompany 类表示。第 2 页
DogWalker 类表示。你将为 DogWalker 类编写两个方法。第 3 页
第 4 页
A.
walkDogs 方法,该方法会更新并返回这位遛狗员在 hour 指定时间内遛的狗的数量。hour 的取值范围是 0 到 23(含)。DogWalkCompany 类中,已经提供了一个辅助方法 numAvailableDogs。maxDogs 的值。DogWalkCompany 类中,还提供了另一个辅助方法 updateDogs。walkDogs 方法应使用 updateDogs,用这位遛狗员在给定小时将要遛的狗的数量来更新遛狗公司。updateDogs 方法的参数表示这位遛狗员在 hour 指定时间内将遛多少只狗。updateDogs 表明这位遛狗员将在该小时遛这 10 只狗中的 4 只。updateDogs 表明这位遛狗员将在该小时把这 3 只可供遛的狗全部遛完。walkDogs 方法应返回这位遛狗员在 hour 指定时间内将要遛的狗的数量。walkDogs 方法。要获得满分,你必须正确使用 numAvailableDogs 和 updateDogs。第 5 页
B.
dogWalkShift 方法,该方法执行从 startHour 到 endHour(含)的整个遛狗班次,并返回总收入。- 遛到了
maxDogs只狗
- 遛狗时间发生在高峰时段 9 到 17 点(含)
小时 | 最大可遛狗数 | 实际遛狗数 | 收入(美元) |
7 | 3 | 3 | 3 × 5 + 3 = 18 |
8 | 3 | 2 | 2 × 5 = 10 |
9 | 3 | 2 | 2 × 5 + 3 = 13 |
10 | 3 | 3 | 3 × 5 + 3 = 18 |
总计 | ㅤ | ㅤ | 59 |
dogWalkShift 方法。假设 walkDogs 按照题意正常工作,而不考虑你在(a)部分写了什么。要获得满分,你必须正确使用 walkDogs。第 2 题
SignedText 类。该类中的方法用于把一个“签名”作为文本字符串的一部分。你需要编写完整的 SignedText 类,其中包含一个构造方法和两个方法。SignedText 的构造方法接收两个 String 参数。第一个参数是名字(first name),第二个参数是姓氏(last name)。第二个参数的长度始终大于等于 1。getSignature 方法不接收任何参数,并根据名字和姓氏按以下规则返回一个格式化后的签名字符串:- 如果名字是空字符串,则返回的签名字符串只包含姓氏。
- 如果名字不是空字符串,则返回的签名字符串应依次由以下内容组成:
-、姓氏。addSignature 方法返回其 String 参数的一个可能被修改后的副本。该参数中至多包含一次该对象的签名,并且这个签名只可能出现在参数字符串的开头或结尾。返回的字符串按照以下规则生成:- 如果该对象的签名没有出现在该方法的字符串参数中,则返回值是:原参数字符串 + 签名。
- 如果该对象的签名出现在参数末尾,则返回值就是原参数字符串,不变。
- 如果该对象的签名出现在参数开头,则返回值是:将原参数开头的签名去掉,再把这个签名追加到参数末尾。
示例执行过程(第 2 页表格)
SignedText 类以外的另一个类中。表格内容如下:1
SignedText 对象 st1 的名字为空字符串,姓氏为 "Wong"。2
3
SignedText 对象 st2 的名字是 "henri",姓氏是 "dubois"。4
5
SignedText 对象 st3 的名字是 "GRACE",姓氏是 "LOPEZ"。6
7
SignedText 对象 st4 的名字为空字符串,姓氏为 "FOX"。8
9
addSignature 的参数中,所以返回字符串是在原参数后面附加签名后的结果。10
11
addSignature 参数的末尾,所以返回值与原参数完全相同。第 3 页表格续
12
13
addSignature 参数的开头,因此返回字符串是:将原参数开头的签名去掉,再把签名追加到参数末尾。14
15
addSignature 参数的开头,因此返回字符串是:将原参数开头的签名去掉,再把签名追加到参数末尾。最后一行要求
SignedText 类。你的实现必须满足所有规格要求,并与表格中的示例一致。- 作者:现代数学启蒙
- 链接:https://www.math1234567.com/article/csafrq2025
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。









