2022
AP
ยฎ
Computer Science A
Sample Student Responses
and Scoring Commentary
Inside:
Free-Response Question 1
Scoring Guidelines
Student Samples
Scoring Commentary
ยฉ 2022 College Board. College Board, Advanced Placement, AP, AP Central, and the acorn logo are registered
trademarks of College Board. Visit College Board on the web: collegeboard.org.
AP Central is the o๎†ฑcial online home for the AP Program: apcentral.collegeboard.org.
APยฎ๎€ƒComputer๎€ƒScience๎€ƒA๎€ƒ2022๎€ƒScoring๎€ƒGuidelines๎€ƒ ๎€ƒ
ยฉ๎€ƒ2022๎€ƒCollege๎€ƒBoard๎€ƒ
Applying๎€ƒthe๎€ƒScoring๎€ƒCriteria๎€ƒ๎€ƒ
๎€ƒ
Apply๎€ƒthe๎€ƒquestion๎€ƒscoring๎€ƒcriteria๎€ƒfirst,๎€ƒwhich๎€ƒalways๎€ƒtakes๎€ƒprecedence.๎€ƒPenalty๎€ƒpoints๎€ƒcan๎€ƒonly๎€ƒbe๎€ƒ
deducted๎€ƒin๎€ƒa๎€ƒpart๎€ƒof๎€ƒthe๎€ƒquestion๎€ƒthat๎€ƒhas๎€ƒearned๎€ƒcredit๎€ƒvia๎€ƒthe๎€ƒquestion๎€ƒrubric.๎€ƒNo๎€ƒpart๎€ƒof๎€ƒa๎€ƒquestion๎€ƒ(a,๎€ƒb,๎€ƒc)๎€ƒ
may๎€ƒhave๎€ƒa๎€ƒnegative๎€ƒpoint๎€ƒtotal.๎€ƒA๎€ƒgiven๎€ƒpenalty๎€ƒcan๎€ƒbe๎€ƒassessed๎€ƒonly๎€ƒonce๎€ƒfor๎€ƒa๎€ƒquestion,๎€ƒeven๎€ƒif๎€ƒit๎€ƒoccurs๎€ƒ
multiple๎€ƒtimes๎€ƒor๎€ƒin๎€ƒmultiple๎€ƒparts๎€ƒof๎€ƒthat๎€ƒquestion.๎€ƒA๎€ƒmaximum๎€ƒof๎€ƒ3๎€ƒpenalty๎€ƒpoints๎€ƒmay๎€ƒbe๎€ƒassessed๎€ƒper๎€ƒ
question.๎€ƒ
๎€ƒ
1โ€Point๎€ƒPenalty๎€ƒ
v)๎€ƒArray/collection๎€ƒaccess๎€ƒconfusion๎€ƒ([] get)๎€ƒ
w)๎€ƒExtraneous๎€ƒcode๎€ƒthat๎€ƒcauses๎€ƒsideโ€effect๎€ƒ(e.g.,๎€ƒprinting๎€ƒto๎€ƒoutput,๎€ƒincorrect๎€ƒprecondition๎€ƒcheck)๎€ƒ
x)๎€ƒLocal๎€ƒvariables๎€ƒused๎€ƒbut๎€ƒnone๎€ƒdeclared๎€ƒ
y)๎€ƒDestruction๎€ƒof๎€ƒpersistent๎€ƒdata๎€ƒ(e.g.,๎€ƒchanging๎€ƒvalue๎€ƒreferenced๎€ƒby๎€ƒparameter)๎€ƒ
z)๎€ƒVoid๎€ƒmethod๎€ƒor๎€ƒconstructor๎€ƒthat๎€ƒreturns๎€ƒa๎€ƒvalue๎€ƒ
๎€ƒ
No๎€ƒPenalty๎€ƒ
๏‚ท Extraneous๎€ƒcode๎€ƒwith๎€ƒno๎€ƒsideโ€effect๎€ƒ(e.g.,๎€ƒvalid๎€ƒprecondition๎€ƒcheck,๎€ƒnoโ€op)๎€ƒ
๏‚ท Spelling/case๎€ƒdiscrepancies๎€ƒwhere๎€ƒthere๎€ƒis๎€ƒno๎€ƒambiguity*๎€ƒ
๏‚ท Local๎€ƒvariable๎€ƒnot๎€ƒdeclared๎€ƒprovided๎€ƒother๎€ƒvariables๎€ƒare๎€ƒdeclared๎€ƒin๎€ƒsome๎€ƒpart๎€ƒ
๏‚ท private or public qualifier๎€ƒon๎€ƒa๎€ƒlocal๎€ƒvariable๎€ƒ
๏‚ท Missing public qualifier๎€ƒon๎€ƒclass๎€ƒor๎€ƒconstructor๎€ƒheader๎€ƒ
๏‚ท Keyword๎€ƒused๎€ƒas๎€ƒan๎€ƒidentifier๎€ƒ
๏‚ท Common๎€ƒmathematical๎€ƒsymbols๎€ƒused๎€ƒfor๎€ƒoperators๎€ƒ(ร—๎€ƒโ€ข๎€ƒรท๎€ƒโ‰ค๎€ƒโ‰ฅ๎€ƒ<>๎€ƒโ‰ )๎€ƒ
๏‚ท [] vs. () vs. <>๎€ƒ
๏‚ท = instead๎€ƒof == and๎€ƒvice๎€ƒversa๎€ƒ
๏‚ท length/size confusion๎€ƒfor๎€ƒarray, String, List, or ArrayList; with๎€ƒor๎€ƒwithout ( )๎€ƒ
๏‚ท Extraneous [] when๎€ƒreferencing๎€ƒentire๎€ƒarray๎€ƒ
๏‚ท [i,j] instead๎€ƒof [i][j]๎€ƒ
๏‚ท Extraneous๎€ƒsize๎€ƒin๎€ƒarray๎€ƒdeclaration,๎€ƒe.g., int[size] nums = new int[size];๎€ƒ
๏‚ท Missing ; where๎€ƒstructure๎€ƒcl
early๎€ƒconveys๎€ƒintent๎€ƒ
๏‚ท Missing { } where๎€ƒindentation๎€ƒclearly๎€ƒconveys๎€ƒintent๎€ƒ
๏‚ท Missing ( ) on๎€ƒparameterโ€less๎€ƒmethod๎€ƒor๎€ƒconstructor๎€ƒinvocations๎€ƒ
๏‚ท Missing ( ) around if or while conditions๎€ƒ
๎€ƒ
*Spelling๎€ƒand๎€ƒcase๎€ƒdiscr
epancies๎€ƒfor๎€ƒidentifiers๎€ƒfall๎€ƒunder๎€ƒthe๎€ƒโ€œNo๎€ƒPenaltyโ€๎€ƒca
tegory๎€ƒonly๎€ƒif๎€ƒthe๎€ƒcorrection๎€ƒcan๎€ƒ
be๎€ƒunambiguously๎€ƒinferred๎€ƒfrom๎€ƒcontext,๎€ƒfor๎€ƒexample,๎€ƒโ€œArayListโ€๎€ƒinstead๎€ƒof๎€ƒโ€œArrayListโ€.๎€ƒAs๎€ƒa๎€ƒcounterexample,๎€ƒ
note๎€ƒthat๎€ƒif๎€ƒthe๎€ƒcode๎€ƒdeclares "int G=99, g=0;", then๎€ƒuses "while (G < 10)" instead๎€ƒof
"while (g < 10)", the๎€ƒcontext๎€ƒdoes๎€ƒnot๎€ƒallow๎€ƒfor๎€ƒthe๎€ƒreader๎€ƒto๎€ƒassume๎€ƒthe๎€ƒuse๎€ƒof๎€ƒthe๎€ƒlower๎€ƒcase๎€ƒ
variable.๎€ƒ
๎€ƒ
๎€ƒ๎€ƒ
APยฎ๎€ƒComputer๎€ƒScience๎€ƒA๎€ƒ2022๎€ƒScoring๎€ƒGuidelines๎€ƒ ๎€ƒ
ยฉ๎€ƒ2022๎€ƒCollege๎€ƒBoard๎€ƒ
Question๎€ƒ1:๎€ƒMethods๎€ƒand๎€ƒControl๎€ƒStructures๎€ƒ๎€ƒ 9๎€ƒpoints๎€ƒ
๎€ƒ
๎€ƒ
Canonical๎€ƒsolution๎€ƒ
๎€ƒ
(a)๎€ƒ
๎€ƒ
public int getScore()
{
int score = 0;
if (levelOne.goalReached())
{
score = levelOne.getPoints();
if (levelTwo.goalReached())
{
score += levelTwo.getPoints();
if (levelThree.goalReached())
{
score += levelThree.getPoints();
}
}
}
if (isBonus())
{
score *= 3;
}
return score;
}
๎€ƒ
4๎€ƒpoints๎€ƒ
(b)๎€ƒ
public int playManyTimes(int num)
{
int max = 0;
for (int i = 0; i < num; i++)
{
play();
int score = getScore();
if (score > max)
{
max = score;
}
}
return max;
}
5๎€ƒpoints๎€ƒ
๎€ƒ๎€ƒ ๎€ƒ
๎€ƒ ๎€ƒ ๎€ƒ
๎€ƒ๎€ƒ
APยฎ๎€ƒComputer๎€ƒScience๎€ƒA๎€ƒ2022๎€ƒScoring๎€ƒGuidelines๎€ƒ ๎€ƒ
ยฉ๎€ƒ2022๎€ƒCollege๎€ƒBoard๎€ƒ
(a)๎€ƒ
getScore
๎€ƒ
๎€ƒ
๎€ƒ
Scoring๎€ƒCriteria๎€ƒ Decision๎€ƒRules๎€ƒ ๎€ƒ
1๎€ƒ Calls getPoints, goalReached, and
isBonus
Responses๎€ƒwill๎€ƒnot๎€ƒearn๎€ƒthe๎€ƒpoint๎€ƒif๎€ƒthey๎€ƒ 1๎€ƒpoint๎€ƒ
๏‚ท fail๎€ƒto๎€ƒcall getPoints or
goalReached on๎€ƒa Level object๎€ƒ
๏‚ท call isBonus on๎€ƒan๎€ƒobject๎€ƒother๎€ƒthan
this (use๎€ƒof this is๎€ƒoptional)๎€ƒ
๏‚ท include๎€ƒparameters๎€ƒ
๎€ƒ๎€ƒ
๎€ƒ
2๎€ƒ Determines๎€ƒif๎€ƒpoints๎€ƒare๎€ƒearned๎€ƒbased๎€ƒon
goalReached return๎€ƒvalues
๎€ƒ
Responses๎€ƒcan๎€ƒstill๎€ƒearn๎€ƒthe๎€ƒpoint๎€ƒeven๎€ƒif๎€ƒ
they๎€ƒ
1๎€ƒpoint๎€ƒ
๏‚ท calculate๎€ƒthe๎€ƒscore๎€ƒtotal๎€ƒincorrectly๎€ƒ
๏‚ท call goalReached incorrectly๎€ƒ
๏‚ท fail๎€ƒto๎€ƒdistinguish๎€ƒall๎€ƒcases๎€ƒcorrectly๎€ƒ
Responses๎€ƒwill๎€ƒnot๎€ƒearn๎€ƒthe๎€ƒpoint๎€ƒif๎€ƒthey๎€ƒ๎€ƒ
๏‚ท fail๎€ƒto๎€ƒuse๎€ƒa๎€ƒnested if statement๎€ƒor๎€ƒ
equivalent๎€ƒ
๎€ƒ
๎€ƒ
๎€ƒ
3๎€ƒ Guards๎€ƒupdate๎€ƒof๎€ƒscore๎€ƒfor๎€ƒbonus๎€ƒgame๎€ƒ
based๎€ƒon isBonus return๎€ƒvalue
Responses๎€ƒcan๎€ƒstill๎€ƒearn๎€ƒthe๎€ƒpoint๎€ƒeven๎€ƒif๎€ƒ
they๎€ƒ
1๎€ƒpoint๎€ƒ
๏‚ท triple๎€ƒthe๎€ƒcalculated๎€ƒscore๎€ƒincorrectly๎€ƒ
๏‚ท update๎€ƒthe๎€ƒscore๎€ƒwith๎€ƒsomething๎€ƒother๎€ƒ
than๎€ƒtripling๎€ƒ
๏‚ท call isBonus incorrectly๎€ƒ
๎€ƒ
Responses๎€ƒwill๎€ƒnot๎€ƒearn๎€ƒthe๎€ƒpoint๎€ƒif๎€ƒthey๎€ƒ๎€ƒ
๏‚ท use๎€ƒthe isBonus return๎€ƒvalue๎€ƒ
incorrectly๎€ƒ
๎€ƒ
๎€ƒ
4๎€ƒ Initializes๎€ƒand๎€ƒaccumulates๎€ƒappropriate๎€ƒ
score๎€ƒ(algorithm)๎€ƒ
Responses๎€ƒcan๎€ƒstill๎€ƒearn๎€ƒthe๎€ƒpoint๎€ƒeven๎€ƒif๎€ƒ
they๎€ƒ
1๎€ƒpoint๎€ƒ
๏‚ท call๎€ƒmethods๎€ƒincorrectly,๎€ƒas๎€ƒlong๎€ƒas๎€ƒ
method๎€ƒcalls๎€ƒare๎€ƒattempted๎€ƒ
๏‚ท fail๎€ƒto๎€ƒreturn๎€ƒthe๎€ƒscore๎€ƒ(return๎€ƒis๎€ƒnot๎€ƒ
assessed)๎€ƒ
๎€ƒ
Responses๎€ƒwill๎€ƒnot๎€ƒearn๎€ƒthe๎€ƒpoint๎€ƒif๎€ƒthey๎€ƒ๎€ƒ
๏‚ท calculate๎€ƒthe๎€ƒscore๎€ƒtotal๎€ƒincorrectly๎€ƒ
๏‚ท triple๎€ƒthe๎€ƒcalculated๎€ƒscore๎€ƒincorrectly๎€ƒ
๎€ƒ ๎€ƒ๎€ƒTotal๎€ƒfor๎€ƒpart๎€ƒ(a)๎€ƒ 4๎€ƒpoints๎€ƒ
๎€ƒ
๎€ƒ๎€ƒ
APยฎ๎€ƒComputer๎€ƒScience๎€ƒA๎€ƒ2022๎€ƒScoring๎€ƒGuidelines๎€ƒ ๎€ƒ
ยฉ๎€ƒ2022๎€ƒCollege๎€ƒBoard๎€ƒ
(b)๎€ƒ
playManyTimes๎€ƒ
๎€ƒ
๎€ƒ
๎€ƒ
Scoring๎€ƒCriteria๎€ƒ Decision๎€ƒRules๎€ƒ
๎€ƒ
5๎€ƒ Loops num times๎€ƒ
๎€ƒ
Responses๎€ƒcan๎€ƒstill๎€ƒearn๎€ƒthe๎€ƒpoint๎€ƒeven๎€ƒif๎€ƒ
they๎€ƒ๎€ƒ
1๎€ƒpoint๎€ƒ
๏‚ท return๎€ƒearly๎€ƒ
6๎€ƒ Calls play and getScore Responses๎€ƒwill๎€ƒnot๎€ƒearn๎€ƒthe๎€ƒpoint๎€ƒif๎€ƒthey๎€ƒ๎€ƒ 1๎€ƒpoint๎€ƒ
๏‚ท call๎€ƒeither๎€ƒmethod๎€ƒon๎€ƒan๎€ƒobject๎€ƒother๎€ƒ
than this (use๎€ƒof this is๎€ƒoptional)๎€ƒ
๏‚ท include๎€ƒparameters๎€ƒ
7๎€ƒ Compares๎€ƒa๎€ƒscore๎€ƒto๎€ƒan๎€ƒidentified๎€ƒmax๎€ƒor๎€ƒto๎€ƒ
another๎€ƒscore
๎€ƒ
Responses๎€ƒcan๎€ƒstill๎€ƒearn๎€ƒthe๎€ƒpoint๎€ƒeven๎€ƒif๎€ƒ
they๎€ƒ๎€ƒ
1๎€ƒpoint๎€ƒ๎€ƒ
๏‚ท make๎€ƒthe๎€ƒcomparison๎€ƒoutside๎€ƒthe๎€ƒloop๎€ƒ
๏‚ท call getScore incorrectly๎€ƒ
๏‚ท fail๎€ƒto๎€ƒcall play between๎€ƒcalls๎€ƒto
getScore
๎€ƒ
8๎€ƒ Identifies๎€ƒthe๎€ƒmaximum๎€ƒscore๎€ƒ(algorithm)๎€ƒ Responses๎€ƒwill๎€ƒnot๎€ƒearn๎€ƒthe๎€ƒpoint๎€ƒif๎€ƒthey๎€ƒ 1๎€ƒpoint๎€ƒ๎€ƒ
๏‚ท fail๎€ƒto๎€ƒinitialize๎€ƒthe๎€ƒresult๎€ƒvariable๎€ƒ
๏‚ท compare๎€ƒa๎€ƒscore๎€ƒto๎€ƒan๎€ƒidentified๎€ƒmax๎€ƒor๎€ƒ
to๎€ƒanother๎€ƒscore๎€ƒoutside๎€ƒthe๎€ƒloop๎€ƒ
๏‚ท fail๎€ƒto๎€ƒcall play exactly๎€ƒonce๎€ƒeach๎€ƒ
time๎€ƒthrough๎€ƒthe๎€ƒloop๎€ƒ
๎€ƒ
9๎€ƒ
Returns๎€ƒidentified๎€ƒmaximum๎€ƒscore๎€ƒ
๎€ƒ
๎€ƒ
Responses๎€ƒcan๎€ƒstill๎€ƒearn๎€ƒthe๎€ƒpoint๎€ƒeven๎€ƒif๎€ƒ
they๎€ƒ
1๎€ƒpoint๎€ƒ
๏‚ท calculate๎€ƒthe๎€ƒmaximum๎€ƒscore๎€ƒincorrectly๎€ƒ
๎€ƒ
Responses๎€ƒwill๎€ƒnot๎€ƒearn๎€ƒthe๎€ƒpoint๎€ƒif๎€ƒthey๎€ƒ๎€ƒ
๏‚ท assign๎€ƒa๎€ƒvalue๎€ƒto๎€ƒthe๎€ƒidentified๎€ƒ
maximum๎€ƒscore๎€ƒwithout๎€ƒany๎€ƒloop๎€ƒor๎€ƒ
logic๎€ƒto๎€ƒfind๎€ƒthe๎€ƒmaximum๎€ƒ
๎€ƒ
๎€ƒ
๎€ƒ๎€ƒ ๎€ƒ Total๎€ƒfor๎€ƒpart๎€ƒ(b)๎€ƒ 5๎€ƒpoints๎€ƒ
๎€ƒ Questionโ€specific๎€ƒpenalties๎€ƒ ๎€ƒ ๎€ƒ
๎€ƒNone๎€ƒ ๎€ƒ๎€ƒ ๎€ƒ
๎€ƒ๎€ƒ ๎€ƒ Total๎€ƒfor๎€ƒquestion๎€ƒ1๎€ƒ 9๎€ƒpoints๎€ƒ
๎€ƒ
๎€๎€๎€๎€๎€๎€‚
๎€ƒ๎€„๎€…๎€๎€†๎€๎€๎€๎€๎€๎€๎€๎€๎€๎€๎€๎€๎€‡
๎€๎€…๎€ˆ๎€‡๎€‰๎€Ž๎€Š๎€‹
๎€
๎€…๎€’๎€˜๎€—๎€๎€‡๎€•๎€ ๎€ƒ๎€ฆ๎€„๎€–๎€“๎€˜๎€‘๎€Š๎€ข๎€Š๎€‘๎€ฅ๎€ฆ๎€‹๎€‘๎€‘๎€ฆ๎€Ž๎€”๎€ฆ๎€ก๎€๎€Š๎€ฆ๎€ˆ๎€๎€š๎€ˆ๎€‘๎€Š
๎€
๎€ก๎€๎€†๎€ก๎€ฆ๎€‰๎€œ๎€ฆ๎€ก๎€–๎€ฆ๎€ข๎€๎€Š๎€ฆ๎€™๎€ฃ๎€Š๎€ž๎€ก๎€๎€”๎€ฆ๎€ฅ๎€–๎€ค
๎€
๎€†๎€›๎€Š๎€ฆ๎€†๎€”๎€Ÿ๎€Š๎€›๎€Ž๎€”๎€Œ๎€ฆ๎€–๎€”๎€ฆ๎€ก๎€๎€Ž๎€ž๎€ฆ๎€˜๎€†๎€Œ๎€Š๎€‚
๎€
๎€‚๎€Ž๎€†๎€ˆ๎€Œ๎€‹๎€1 ๎€ƒ๎€Ž๎€‡๎€Š๎€Œ๎€‹๎€2 ๎€ƒ๎€„๎€Œ๎€‹๎€3 ๎€๎€‹๎€4 e
e
O
O
0
๎€
๎€‚๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†
๎€ƒ
๎€
๎€ƒ๎€„๎€… ๎€‚๎€๎€…
๎€‚๎€…๎€ˆ๎€Š๎€Œ๎€™๎€˜๎€Ž๎€–๎€‘๎€™ ๎€‘๎€…๎€’๎€๎€Ž๎€Œ๎€“๎€…๎€™๎€”๎€Ž๎€™๎€…๎€ƒ๎€„๎€‰๎€™๎€๎€—๎€…๎€“๎€”๎€‹๎€Ž๎€๎€™๎€ƒ๎€•๎€™๎€•๎€‰๎€…๎€™ ๎€”๎€Ž๎€๎€™๎€Ž๎€‡๎€™ ๎€ƒ๎€™๎€Œ๎€†๎€™๎€๎€ƒ๎€ˆ๎€…๎€๎€™
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€„
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๏ฟฝ๎€„๎€‚\l๎€… i๎€‚
๏ฟฝ ๏ฟฝ๎€‚r๎€ƒl)
l
๏ฟฝ'JI/ I ยท\๎€
๎€„๎€Œ๎€
๎€†๎€Œ๎€…๎€‰๎€Œ๎€Š๎€ˆ๎€‹๎€Œ๎€‡๎€‚๎€ƒ๎€Œ
l
Pa๎€…2
๎€๎€…
๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†๎€†
๎€†๎€†๎€†๎€†๎€‡
๎€
๎€‹๎€†๎€๎€…๎€๎€๎€‹๎€…๎€ˆ๎€‰๎€๎€–๎€”๎€‘๎€œ๎€‚๎€๎€„๎€–๎€ ๎€‡๎€ˆ๎€Š๎€w๎€ƒ ๎€œ๎€•๎€š๎€—๎€๎€”๎€Œ๎€“๎€ƒ๎€Do ๎€‡๎€‰๎€w๎€„ ๎€–๎€š๎€™๎€’๎€Ž๎€๎€˜๎€๎€๎€๎€๎€–๎€›๎€‚๎€
๎€
๎€
๎€
๎€‚๎€ƒ๎€ƒ๎€„
๎€ƒ๎€„ ๎€ƒ๎€„
๎€ƒ๎€ƒ ๎€ƒ๎€ƒ๎€„
๎€ ๎€๎€‚๎€ƒ๎€„๎€…๎€†๎€†๎€‡๎€ˆ๎€‰๎€Š๎€๎€„๎€…๎€‚ ๎€ƒ๎€† ๎€Œ
๎€ƒ
Q1 Sample A 1 of 2
๎€‚๎€•๎€ƒ๎€ƒ๎€„๎€…๎€๎€๎€†๎€‡๎€ˆ๎€‰๎€”๎€Š๎€‹๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€Œ๎€๎€Ž
I Im๎€…nt: ๎€ˆ๎€ท๎„๎€ฒ๎€š๎•๎€š๎€ถ๎ช๎€ก๎€ฉ๎€ฒ๎€ณ๎ช๎€ฉ๎€น๎ช๎•๎€ค๎€š๎ช๎€”๎€ช๎‹๎€”๎€ณ๎€š๎ช
๎œ๎€๎–๎ช๎€—๎‹๎๎๎„๎€๎€ฝ๎€˜๎๎ช๎—๎€๎ช๎—๎€ง๎€›๎ช๎‡๎๎€š๎๎—๎€ซ๎€๎€น๎ช๎ง๎€๎๎ช
๎€๎๎ช๎€๎€บ๎”๎€›๎Œ๎€ฉ๎€ฝ๎€ข๎ช๎€๎€ฝ๎ช๎—๎€ค๎€ฌ๎๎ช๎…๎€๎€ข๎€›๎€‚๎ช
๎€๎ ๎€œ๎‘๎˜๎€ญ๎๎€ป๎ช1
๎€๎ก๎‘๎˜๎€ฏ๎‚๎€พ๎ช2
๎€๎ž๎€œ๎“๎€ป๎ช3
๎€๎ž๎€๎€ ๎€ฑ๎๎€ป๎ช๎€†๎ช
e
O
O
0
๎€‡๎€ž๎€ฃ๎€ซ๎€ผ๎ช๎ง๎€ฟ๎Ÿ๎‰๎ช๎‰๎€š๎’๎…๎€ฟ๎€ผ๎’๎€ž๎ช๎™๎€ฟ๎ช๎€š๎€‘๎€•๎€ฅ๎ช๎ˆ๎Ÿ๎€ž๎’๎™๎€ฎ๎€ฟ๎€ผ๎ช๎€‘๎™๎ช๎š๎€ฆ๎€Ÿ๎ช๎š๎€ฟ๎ƒ๎ช๎€ฟ๎€ก๎ช๎€‘๎ช๎€ผ๎€š๎ข๎ช๎„๎€‘๎€ฃ๎€ž๎€ƒ๎ช
๎€‚๎€‰๎€
๎€‘๎€’๎€๎€“๎€–
๎€…๎€„๎€Š ๎€๎€‚๎€ƒ
๎€‚๎€‡.
๎€ƒ,' ๎€ƒ๎€๎€‡ ๎€†๎€‡ ๎€„๎€…๎€‡
๎€ƒ๎€
๎€‡๎€Š
๎€ˆ๎€Š
๎€†๎€„๎€‡ ๎€…๎€‡
๎€‚๎€ƒ๎€…
๎€‡๎€๎€๎€๎€ˆ๎€‹๎€'๎€ƒ.
๎€ƒ๎€๎€† I
๎€„๎€‚๎€†
๎€…๎€†
๎€‚๎€Š
ยท
๎€
> ๎€†๎€Š ๎€‰๎€Š
๎€Œ๎€…๎€†
-
๎€๎€ฐ๎€๎จ๎ช๎†๎€พ๎€–๎€ด๎€ฑ๎‚๎€พ๎€ต๎ฆ๎€„๎ช๎€‰๎ช๎€‹๎€Œ๎€Ž๎ช๎ฃ๎Ž๎˜๎€œ๎ช๎ง๎๎ ๎Š๎ช๎€พ๎€’๎€ธ๎€…๎ช๎€Š๎ช๎€‹๎€Œ๎€Ž๎ช๎ค๎€œ๎ช๎‚๎ž๎›๎€ฑ๎€™๎ช๎˜๎€จ๎ช๎€“๎ฅ๎€…๎ช
0059342
๎€๎€๎€๎€ƒ
๎€‚๎€‚๎€ƒ
๎€๎€๎€๎€๎€๎€ƒ
๎€๎€๎€
๎€‚ ๎€‚๎€ƒ ๎€‚๎€‚
๎€„๎€…
๎€‚๎€ƒ
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€Š๎€„๎€ƒ๎€
๎€
๎ฉ๎ช
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
1
๎€
๎€
๎€
โ€ขยท- J
Q1 Sample A 2 of 2
r
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
๎€Ž
๎€๎€๎€„๎€
-
-
-
-
-
-
๎€ˆ๎€๎€ฅ๎€ช๎€‹๎€ž๎€ฐ๎€†๎€ถ๎€‡๎€š๎€๎€ฑ๎€๎€œ๎€ถ๎€’๎€›๎€š๎€ถ๎€‰๎€ž๎€ถ๎€ฑ๎€”๎€๎€ถ๎€๎€—๎€ฉ๎€๎€š๎€๎€ถ
๎€ฑ๎€•๎€Œ๎€ฑ๎€ถ๎€๎€ข๎€ฉ๎€ฉ๎€๎€ซ๎€ฆ๎€ ๎€Ž๎€ฌ๎€ถ๎€ฑ๎€ข๎€ถ๎€ฑ๎€”๎€๎€ถ๎€ง๎€ฒ๎€๎€ซ๎€ฑ๎€—๎€ข๎€Ÿ๎€ถ๎€ต๎€ข๎€ณ๎€ถ
๎€Œ๎€จ๎€๎€ถ๎€Œ๎€ ๎€ฏ๎€๎€จ๎€—๎€ ๎€“๎€ถ๎€ข๎€ก๎€ถ๎€ฑ๎€–๎€˜๎€ญ๎€ถ๎€ค๎€Œ๎€“๎€๎€๎€ถ
๎€Š๎€ด๎€๎€ฎ๎€ฐ๎€™๎€ฃ๎€ž๎€ถ๎€‚๎€ถ ๎€Š๎€ด๎€๎€ฎ๎€ฐ๎€™๎€ฃ๎€ž๎€ถ๎€ƒ๎€ถ ๎€Š๎€ด๎€‘๎€ฐ๎€™๎€ฃ๎€ž๎€ถ๎€„๎€ถ ๎€Š๎€ด๎€๎€ฎ๎€ฐ๎€™๎€ฃ๎€ž๎€ถ๎€…๎€ถ
e
O
O
0
๎€ƒ)
๎€‰๎€‚๎€“
๎€‚๎€…๎€ˆ๎€‹๎€๎€š๎€™๎€Ž๎€˜๎€’๎€š๎€’๎€…๎€“๎€๎€๎€”๎€…๎€š๎€•๎€Ž๎€š๎€…๎€ƒ๎€„๎€‰๎€š๎€‘๎€˜๎€…๎€”๎€—๎€Œ๎€Ž๎€๎€š๎€ƒ๎€•๎€š๎€•๎€Š๎€…๎€š๎€–๎€Ž๎€๎€š๎€Ž๎€‡๎€š๎€ƒ๎€š๎€๎€†๎€š๎€๎€ƒ๎€ˆ๎€…๎€๎€š
๎ƒ“
๎ƒฝ๎‚ฝ๎‘
๎€„๎„ข
๎‚š๎‚ฎ๎ƒณ๎€Ÿ
๎€น
๎ผ๎ƒญ๎œ๎ฉ๎‚พ๎ƒ˜๎„ข๎€Œ๎€๎„ข๎„„๎„ข
๎€๎€‘๎€’๎€…๎€ ๎€๎€˜๎€ ๎€†๎€ ๎€š๎€ ๎€‡๎€ ๎€›๎€ˆ๎€•๎€‰๎€
๎€œ๎€ r, ๎€™๎€“๎€ ๎€๎€๎€Œ๎€–๎€—๎€Š๎€‚๎€ ๎€‹๎€
inf๎€„๎€๎€† = o;
๎‚›๎‚Ž๎„ข๎„…๎€‚๎ฝ๎„“๎€๎„”๎€ž๎„๎€ก๎–๎‚ธ๎‚†๎€ข๎„ข๎‚•๎€ถ๎„ข๎š๎พ๎‚ฟ๎ช๎‚™๎ป๎‚ฅ๎„•๎‰๎„–๎ฟ๎€ฃ๎€‘๎€ค๎„†๎€ฅ๎„ข
๎ƒค๎ซ๎ƒ€๎ƒ™๎€”๎Š๎„ข๎ก๎‚ˆ๎ฅ๎‚€๎ƒฎ๎ƒ๎‚ฏ
๎€…
๎€ฆ๎„ข๎‚“๎„—๎—๎ƒ‚๎‚œ๎ƒƒ๎ƒน๎„ข๎€๎‚ฆ๎„ข๎ข๎„ข
๎‚๎‚๎„ข๎€ƒ๎€…๎€Š๎€๎€‹๎€†๎€‰๎€๎€„๎€๎€Ž๎€ˆ๎€Œ๎€‚๎€‡๎€๏ฟฝ๎€ ๎„˜๎‚ง๎„ข๎„‡๎„ข
๎ƒฅ๎ด๎ƒ„๎„™๎„ข
๎€๎„ข๎€ƒ๎„ข
๎€•๎‚„๎€ฏ๎ƒฟ๎‚Š๎€ฑ๎€–๎€—๎„‚๎€ง๎„ข๎ƒ”๎‚Œ๎‚จ๎ƒป๎„ข( ๎€‹๎ฃ๎„ข
}
๎€‚๎€ƒ๎€† ๎Ž๎„ข,๎€ƒ"๎€„t ๎Ÿ๎ณ๎‚๎€จ๎„ข๎€บ๎ƒ…๎ฆ๎€‚๎›๎‚‹๎ฒ๎€ฎ๎‚ฐ๎‚‚๎บ๎€Ž๎‚ฉ๎„ข๎€ป๎€ฝ๎„ข๎€‚) t
๎€๎ƒ†๎ƒš
๎€๎€ƒ๎„ข
๎€˜๎‚…๎€ฐ๎€†๎‚‰๎ƒฏ๎€Š๎ƒธ๎‚‡๎€ฉ๎„ข๎€‚๎€†๎€…๎€‡๎€๎€ƒ๎€„๎€ˆ๎€‰๎€๎‚ช๎๎„ข
๎€
, ๎€ˆ๎€“ ๎€‡๎€†
๎€…๎€„๎€๎€†๎‚๎”๎„š๎ƒฐ๎ƒฆ๎‚ƒ๎ƒ๎‚น๎ƒพ๎„ข๎€Œ๎€…๎€„๎€”๎€†๎€Š๎€•๎€–๎€‚๎€“๎€๎€ƒ๎€˜t
๎ƒง๎ฌ๎ƒ‡๎ƒก๎Œ ๎ƒจ๎น๎„›๎„ข๎„‘๎„ข๎€ธ๎„ข๎‚๎„ข
๎’๎„ข
๎„Š๎„ข
๎ƒข๎ƒบ๎ƒฃ๎„ข
๎ƒฉ๎„ข๎ต๎ƒˆ๎ƒ›๎„ข๎ƒ
๎ƒ‘๎ ๎จ๎‚ซ๎‚ž๎ญ๎„ข๎‚Ÿ๎‚ฑ๎ƒฑ๎„ข๎ƒ’๎€™๎ง
๎„ƒ๎„ข
๎“๎˜
๎‚ผ
๎ž๎‚ฌ๎€…๎€ต๎„ข(in ๎€ƒ Num) {
๎•๎„œ๎„๎„ข๎€Š๎€‰๎€‹๎€‚๎€ƒ๎€๎€†๎€๎€‡๎€ ๎€ˆ๎€Œ๎€ ๎€๎€๎€„ ๎€…๎€ ๎€๎€๎€Ž๎€
๎‚’๎€ช๎„ž๎‚ฒ๎„Ÿ๎€พ๎ƒ‰๎„๎„ข ๎„๎€ซ๎€ผ๎„ข๎„’๎€ฌ๎„ข-: ,k ๎€š๎„Ž๎€ญ๎„ข ๎„๎€›๎„ข
๎€๎€ƒ๎€„๎€“๎€’๎€๎€“ ๎€๎€Ž๎€‹๎€“๎€…๎€Š๎€Œ๎€“
๎€‘๎€“
๎€๎€„๎€… ๎€‚๎€ƒ๎€…
๎‚‘๎ƒ๎ƒ–๎๎‚ ๎‚ณ๎ƒด๎‚ก๎€ ๎€ท๎€ˆ๎…๎„ข๎‚ข๎„ข๎„ ๎„ข= ๎‚ด๎„€๎‚ญ๎†๎„ข๎€œ๎€ฒ๎€ณ๎„ข๎€’๎„ข๎„ˆ
๎€๎€‚ ๎€‰๎€†๎€…๎€Œ๎€‚๎€Œ๎€ˆ๎€Œ๎€‡๎€Š๎€Œ ๎€๎€ƒ๎€Œ๎€„๎€Œ๎€‹๎€Œ
๎™๎„ก๎ƒ•๎ƒœ๎ƒŠ๎ƒต ๎ƒช
๎€„
๎ƒ‹๎ƒ๎€ฟ๎„ข๎€๎€Ž๎€‘๎€‹๎€‰๎€ˆ๎€๎€‡๎€—๎€’๎€๎€˜
๎ƒฒ๎‚ฃ๎ฎ๎„ข
๎ฏ๎„ข๎„Œ๎๎‡๎„ข
๎‚ค๎‚๎„ข๎๎„ข
๎ถ๎ƒผ๎‚ป๎‚ถ๎ƒถ๎ƒซ๎ท๎ƒŒ๎ƒ—๎„ข
๎€‰๎„ข๎‚–๎€‡๎€๎‚ต๎ƒฌ๎ฐ๎ƒ๎„ข
๎ƒž๎€“๎„ข
๎„‰๎„ข
๎‚—๎„ข๎ค๎‚”๎‚˜๎€ด๎ฑ๎ƒŽ๎ƒŸ๎„ข๎‹๎„ข๎ธ๎„๎‚บ๎‚ท๎ƒท๎๎„‹๎ƒ ๎ˆ๎„ข
J
-
๎€ ๎€‚๎€Œ๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€†๎€Œ๎€„๎€Š๎€‡๎€‹๎€ˆ๎€ƒ๎€Œ๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€…๎€Œ๎€‰๎€Œ
๎€
๎€‰๎€๎€ค๎€Š๎€ค
๎€›
๎€˜๎€๎€–๎€•๎€ค๎€š๎€™๎€•๎€ฃ๎€‚๎€ค๎€„๎€š๎€ค๎€…๎€†๎€‡๎€ค๎€ก๎€๎€“๎€ž๎€‘๎€ค๎€ฃ๎€š๎€ ๎€œ๎€ค๎€˜๎€‹๎€—๎€ƒ๎€ค๎€„๎€š๎€ค๎€…๎€†๎€ˆ๎€ค๎€ก๎€๎€”๎€ค๎€š๎€ ๎€Ÿ๎€Œ๎€–๎€๎€ค๎€Ÿ๎€’๎€‘๎€ค๎€Ž๎€š๎€ข๎€ƒ๎€ค
-
-
-
-โ€ขยท โ€ข
โ€ข
โ€ขโ€ข
โ€ข
โ€ข
โ€ข
0๏ฟฝ๎€‚ C
Q1 Sample B 1 of 1
๎€†
๎€–๎€ฒ๎€ฝ๎‰๎€’๎ž๎€”๎€ก๎‹๎€ก๎€ฑ๎ž๎€ฅ๎ž๎€‚๎€†๎€ˆ๎Š๎€จ๎€ก๎ž๎€ž๎‚๎€ฏ๎€ก
๎€†
๎‹๎€จ๎€š๎‹๎ž๎€๎€ถ๎€๎€๎€ก๎„๎€ป๎€ด๎€Ÿ๎„๎ž๎Š๎€ถ๎ž๎Š๎€จ๎€ก๎ž๎€พ๎๎€ก๎„๎‹๎€ซ๎€ถ๎€ด๎ž๎›๎€ถ๎
๎€ƒ๎€‡๎€„๎€…๎€ˆ๎€Ž๎ž ๎€™๎’๎€ข๎†๎‰๎€ฌ๎€ธ๎€ต๎ž๎€๎ž ๎€™๎”๎†๎๎€ธ๎€ต๎ž๎€๎ž ๎€™๎•๎€ต๎ž๎€‘๎ž ๎๎ž
๎€†
๎€š๎ƒ๎ž๎€š๎€ด๎‡๎€ก๎€๎€ซ๎€ด๎€ง๎ž๎€ถ๎€ด๎ž๎Š๎€จ๎€ซ๎„๎ž๎€บ๎€š๎€ง๎€ก๎€‹
-
e
O
O
0
-
-
-
-
-
-
-
-
-
-
-
-
-
I
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
๎€๎€‚๎€ƒ๎€„
๎€“๎€ก๎€ง๎€ฉ๎€ด๎ž๎œ๎๎€๎ž๎€๎€ก๎…๎€ผ๎€ด๎„๎€ก๎ž๎‹๎€ท๎ž๎€ก๎€š๎€๎€จ๎ž๎€ฟ๎“๎€ก๎…๎Ž๎€ด๎ž๎€š๎‹๎ž๎‹๎€จ๎€ก๎ž๎Œ๎€ท๎€น๎ž๎€ท๎€ค๎ž๎€š๎ž๎€ด๎€ฃ๎ž๎€น๎€š๎€ฆ๎€ก๎€‡๎ž
๏ฟฝ๎€ ,๎€‚ ๎€ƒ๎€๎€„๎€‚๎€…f
๎€ช๎€„๎ˆ๎ž ๎€ƒ๎€ฐ๎€…๎ž Oโ€ข
b๎€๏ฟฝ
ai ๎€†๎€๎€Œ๎€‡๎€๎€ˆ๎€‰๎€๎€ƒ๎€๎€‚๎€‘๎€’๎€‹๎€‡๎€–
๎€๎€‹๎€’๎€ˆ๎€‰๎€’๎€„๎€…๎€†๎€’๎€‚๎€’
๎€๎€ƒ๎€„๎€…๎€† ๎€‚๎€†๎€‚๎€ƒ๎€๎€ ๎€…๎€†๎€Œ๎€ˆ๎€๎€๎€‰๎€‡๎€๎€Ž๎€๎€‹๎€„๎€
๎€Š๎€๎€ƒ๎€ˆ๎€„๎€‚
๎€ˆ๎€๎€Ž๎€“๎€– ๎€…๎€†๎€๎€–
๎€†๎€๎€‡๎€Š๎€๎€‹๎€Œ๎€๎€…๎€ƒ๎€๎€‰๎€๎€‚๎€๎€ˆ๎€๎€Ž๎€๎€„๎€
,Q ๎€‚๎€„๎€…๎€๎€†๎€ƒ๎€ˆ๎€‡๎€ˆ)ยทt:. ๏ฟฝ . ๎€‚๎€๎€ญ
๎€ˆ๎€‰๎ž๎€๎ž
3
๎€‰๎€๎€–+๎€‚ ๎€๎€Œ๎€Š๎€๎€๎€‡๎€‘๎€’
๎€„๎€…๎€†๎€‚
1
๎€„๎€๎€‚๎€†๎€…๎€ˆ๎€‡๎€‹๎€‰๎€‹๎€Š๎€‹๎€ƒ๎€‹
S๎€ƒ ๏ฟฝ๎€ ๎€Œ๎€”๎€Š๎€•๎€„๎€–๎€Ž๎€’๏ฟฝ).
๎€†๎€‰
๎€‡๎€๎€‰
๎€…๎€‰
๏ฟฝ ๎€๎€’๎€‡๎€’1 ๏ฟฝ๎€‚ ๎€‚)c
๎€‹๎€‰๎€…๎€ƒ๎€‚๎€Œ๎€ˆ๎€๎€„๎€Ž๎€๎€†๎€๎€Š
๎€‘๎€’
I
๎€ƒ๎€Š๎€๎€๎€๎€Ž๎€…๎€๎€ƒ๎€๎€‰ ๎€‡๎€ˆ๎€‰๎€„๎€‚๎€‹๎€
๏ฟฝv๎€ ๎€‚ ๎€ƒ 3 ,
J
/
๎€„๎€† ๎€ƒ๎€†
๎€ƒ๎€’
๎€…๎€†๎€๎€†
-
๎€ƒ2
-
๎€
๎€‚๎€‚๎€‚๎€‚๎€‚๎€‚๎€‚๎€‚๎€‚๎€‚
๎€‚๎€‚๎€‚๎€‚๎€…๎€‚๎€‚๎€‚๎€‚๎€‚๎€‚๎€‚๎€‚๎€‚๎€‚๎€‚๎€‚๎€‚
๎€ƒ
๎€
๎€ƒ๎€‚๎€‰๎€Š๎€‡๎€…๎€†๎€Š๎€ธ๎€ต๎€ฎ๎š๎€Š๎ž๎€๎€ˆ๎€—๎€˜๎ž๎—๎ž๎š๎€ธ๎‘๎๎ž๎€ต๎€›๎€ณ๎€‹๎ž๎€•๎€ธ๎ž๎€—๎€˜๎ž๎˜๎ž๎€ธ๎–๎€›๎€ฎ๎€ ๎ž๎€ˆ๎€„๎€Š๎€œ๎™๎€Œ๎ž
-
๎€‚๎€†
-
-
๎€„๎€†๎€†๎€ˆ
โ€ข
๎€†๎€ˆ
๎€†
๎€‡
๎€†๎€†๎€ˆ
. ๎€
๎€†๎€ˆ
๎€๎€‚๎€ƒ๎€„๎€† ๎€…๎€†
Q1 Sample C 1 of 2
๎€๎€‚
๎€ถ ๎€‡๎€ž๎€จ๎€ฐ๎€„๎€ธ๎€…๎€ค๎€Ÿ๎€ง๎€š๎€‘๎€ฏ๎€‘๎€๎€ด๎€ธ๎€’๎€›๎€›๎€ธ๎€—๎€ก๎€ธ๎€ฏ๎€”๎€‘๎€ธ๎€๎€ซ๎€œ๎€‘
๎€ฏ๎€”๎€Š๎€ฏ๎€ธ๎€Ž๎€ช๎€ฌ๎€ญ๎€ง๎€ค๎€ก๎€๎€ญ๎€ธ ๎€ฏ๎€ค๎€ธ๎€ฏ๎€•๎€‘๎€ธ๎€ฉ๎€ฑ๎€‘๎€ญ๎€ฏ๎€™๎€ก๎€ธ๎€ต๎€ฑ
๎€Š๎€ช๎€‘๎€ธ๎€Š๎€ฃ๎€ฎ๎€‘๎€ช๎€—๎€ก๎€“๎€ธ๎€ฅ๎€ก๎€ธ๎€ฏ๎€”๎€˜๎€ญ๎€ธ๎€ง๎€Š๎€“๎€‘๎€
๎€‡๎€š๎€‹๎€˜๎€™๎€๎€”๎€‘๎€Ÿ๎€‚๎€Ÿ
๎€‡๎€›๎€‰๎€Ž๎€”๎€’๎€Ÿ๎€ƒ๎€Ÿ
๎€‡๎€š๎€Œ๎€‰๎€๎€”๎€’๎€Ÿ๎€„๎€Ÿ
๎€ˆ๎€”๎€’๎€Ÿ๎€…๎€Ÿ
๎€‚
๎€
๎€๎€…
๎€๎€…
๎€‚๎€…๎€ˆ๎€‹๎€๎€™๎€˜๎€—๎€“๎€™๎€“๎€…๎€”๎€‘๎€๎€”๎€…๎€™๎€•๎€๎€™ ๎€…๎€ƒ๎€„๎€‰๎€™๎€’๎€—๎€…๎€”๎€–๎€Œ๎€๎€Ž๎€™๎€ƒ๎€•๎€™๎€–๎€Š๎€…๎€™๎€•๎€๎€๎€™๎€๎€‡๎€™๎€ƒ๎€™๎€Ž๎€†๎€™๎€๎€ƒ๎€ˆ๎€…๎€๎€™
๎€‰๎€ˆ๎€ธ๎€ท๎€ธ๎€•๎€‘๎€Š๎€๎€Ž๎€Ÿ๎€”๎€“๎€๎€๎€๎€Ÿ๎€†๎€”๎€Ÿ NOT ๎€ฒ๎€ธ๎€ž๎€”๎€š๎€–๎€Ÿ๎€ข๎€‹๎€ ๎€‚๎€ธ๎€†๎€ธNOT ๎€œ๎€—๎€Œ๎€Ÿ๎€ฆ๎€๎€ธ๎€ฐ๎€–๎€ธ๎€Œ๎€ณ๎€ƒ๎€ธ
0049146
๎€„๎€…
๎€ƒ๎€ƒ๎€ƒ๎€ƒ๎€ƒ๎€ƒ๎€ƒ๎€ƒ๎€ƒ๎€ƒ๎€ƒ๎€… ๎€„
โ€ขโ€ข
โ€ข โ€ข
โ€ขโ€ข
โ€ข โ€ข
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
-
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
-
๎€
๎€
๎€‚
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€‚
-
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
๎€
ยทยท-
Q1 Sample C 2 of 2
AP
ยฎ
Computer Science A 2022 Scoring Commentary
ยฉ 2022 College Board.
Visit College Board on the web: collegeboard.org.
Question 1
Note: Student samples are quoted verbatim and may contain spelling and grammatical errors.
Overview
This question tested the studentโ€™s ability to:
โ€ข Write program code to call methods.
โ€ข Write program code to satisfy method specifications using expressions, conditional statements,
and iterative statements.
More specifically, this question assessed the ability to use Level objects, call methods within and
outside the current class, use nested if logic to calculate a correct score for each level depending on
whether that level and all previous levelsโ€™ goals were met, iterate a specific number of times to
identify a maximum score, and use method return values in conditional expressions.
In part (a) students were asked to declare and initialize a numeric score variable and then call the
getPoints and goalReached methods from the Level class on the instance variables
levelOne, levelTwo, and levelThree in order to calculate a correct score for each level,
depending on whether that level and all previous levelsโ€™ goals were met. Students then had to
evaluate the returned value from isBonus to determine if the score for the game is tripled before
being returned.
In part (b) students were asked to declare and initialize a maximum value variable, iterate num times
to call the play method, and compare the value returned from getScore to the identified
maximum, replacing the maximum as needed in the loop after a correct comparison. The students
then had to return the identified maximum score.
Sample: 1A
Score: 8
In part (a) point 1 was earned by using the correct syntax to call each method, without parameters, at
least once. The methods of the Level class, getPoints and goalReached, are correctly called
on the instance variables levelOne, levelTwo, and levelThree. The isBonus method is
also called correctly. Point 2 was earned by using goalReached return values to determine if
points should be included in the score. Responses can earn point 2 even if they do not correctly
determine which points should be added to the score or if they do not call goalReached correctly.
Point 3 was earned by correctly using the result of isBonus to determine if a bonus should be
added to the score. Responses can still earn point 3 even if they do not calculate the bonus correctly
or if they call isBonus incorrectly. (The isBonus call is assessed in point 1.) Point 4 was earned
because the variable sum is initialized and used to calculate the correct score. Responses can still
earn point 4 even if the return statement is omitted. Calculation of a correct score for levels 2 and
3 depends on whether or not the goal was reached on previous levels. When the condition used to
check if a previous levelโ€™s goal has been reached is missing or incorrect, or if the bonus is incorrectly
computed, point 4 is not earned.
AP
ยฎ
Computer Science A 2022 Scoring Commentary
ยฉ 2022 College Board.
Visit College Board on the web: collegeboard.org.
Question 1 (continued)
In part (b) point 5 was earned because the response correctly uses a for loop to iterate num times.
Point 6 was not earned because the play and getScore method calls are incorrect. The response
uses the class name, Game, to access the methods, which is incorrect since neither play nor
getScore is a static method. The methods are members of the Game class, as is the method being
written. Therefore, the correct method calls are play() and getScore(). Responses may
include the this keyword in calls to these methods. Point 7 was earned because the response
compares an identified maximum variable, highScore, with another score. This point can be
earned even if the getScore method is called incorrectly or if the values being compared are
incorrect. However, the values compared must be identified scores or maximum values. Point 8 was
earned because the response implements the correct algorithm to identify the maximum score. The
play method must be called exactly once each time through the loop, and the maximum score must
be appropriately updated in order for this point to be earned. The response correctly initializes the
maximum value variable, highScore, and updates that variable inside the loop as needed. Point 9
was earned by returning the identified maximum score stored in highScore. To earn this point,
there must be logic to find the maximum or there must be a loop and calculations on the variable that
is returned. The value returned does not have to be the correct maximum score, nor even a
maximum, to earn this point.
Sample: 1B
Score: 5
In part (a) point 1 was not earned because the isBonus method is called incorrectly. The method
call Game.isBonus() is incorrect since isBonus is not a static method and is a member of the
same class as the method being written. Responses may include the this keyword in the method
call (this.isBonus()). The getPoints and goalReached methods are called correctly, but
all three method calls must be correct in order to earn this point. Point 2 was not earned. Even
though the goalReached method is called correctly, there is no attempt to add points only if the
goals of the current level and all previous levels are reached. In order to earn this point, there must
be code that includes level 2โ€™s points in the score only if the goals of levels 1 and 2 are reached or
code that includes level 3โ€™s points in the score only if the goals of levels 1, 2, and 3 are all reached.
This point could have been earned if either the level 2 points or the level 3 points were correctly
handled. Point 3 was earned because the isBonus return value is used to determine whether the
bonus should be added. Point 4 was not earned because points from levels 2 and 3 are added to the
score if the goal of the current level is reached, regardless of whether the previous levelsโ€™ goals were
reached. To earn this point, both the level 2 points and level 3 points must be correctly handled.
In part (b) point 5 was earned because the for loop starts at 1 and loops while i <= num, so
the body of the loop is executed exactly num times. Point 6 was not earned because the response
incorrectly uses the class name, Game, to access the play and getScore methods. Point 7 was
earned because the if statement compares a score with the identified maximum variable,
highScore. This point was earned, even though the response calls getScore incorrectly,
because the incorrect method call is assessed in point 6. Point 8 was earned because the response
correctly identifies the maximum score by declaring a maximum variable, highScore; initializing it
AP
ยฎ
Computer Science A 2022 Scoring Commentary
ยฉ 2022 College Board.
Visit College Board on the web: collegeboard.org.
Question 1 (continued)
to zero; and updating it as needed in the loop after a correct comparison. Point 9 was earned by
returning the identified maximum, highScore.
Sample: 1C
Score: 2
In part (a) point 1 was not earned because the isBonus method is called incorrectly. All method
calls must be correct in order to earn this point. Point 2 was not earned. Even though the
goalReached method is called correctly, there is no attempt to add points only if the goals of the
current level and all previous levels are reached. Point 3 was earned because the isBonus return
value is used to determine whether the bonus should be applied. The incorrect call to isBonus
does not affect this point as the correctness of the method call was assessed in point 1. Point 4 was
not earned because the sequential if statements in the response do not accumulate the appropriate
score. Note that no points were deducted for the missing return statement in part (a).
In part (b) point 5 was earned because the for loop iterates exactly num times. Point 6 was not
earned because the response calls the play and getScore methods on an object other than
this. Point 7 was not earned because there is no comparison of a score with another score or with
an identified maximum value. Point 8 was not earned because the response does not correctly
identify a maximum score. There are no comparisons in the loop, and the loop creates a new Game
object in each iteration, which eliminates the possibility of a maximum. Point 9 was not earned
because there is no return statement and no variable to hold a score or calculated value that could
be returned.