2025/2026 Exam Questions Marking
Scheme New Update | A+ Rated
What does the mystery function do?
function mystery() { while (noBallsPresent()) { move(); } }
JavaScript
Karel moves until it is on a ball
If there is no ball present, Karel will move one time and stop.
Karel moves until it puts down a ball
Karel checks if there is no ball on the current spot and then moves once - 🧠
ANSWER ✔✔Karel moves until it is on a ball
Question: 2
COPYRIGHT©NINJANERD 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435. TERMS OF USE. PRIVACY
1
STATEMENT. ALL RIGHTS RESERVED
,Which of the following is not a valid condition to go in an if statement for
Karel?
ballsPresent()
frontIsClear()
leftIsBlocked()
turnLeft() - 🧠 ANSWER ✔✔turnLeft()
Question: 3
Say Karel is on a location with one tennis ball. After the following code
runs, how many tennis balls will there be at that location?
for (var i = 0; i < 3; i++) { if (ballsPresent()) { takeBall(); } else { putBall();
putBall(); } }
JavaScript
0
1
COPYRIGHT©NINJANERD 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435. TERMS OF USE. PRIVACY
2
STATEMENT. ALL RIGHTS RESERVED
, 2
6 - 🧠 ANSWER ✔✔1
Question: 4
What condition should be used in this while loop to get Karel to pick up all
the tennis balls on the current location?
while (________) { takeBall(); }
JavaScript
noBallsPresent()
ballsPresent()
frontIsClear()
takeBall() - 🧠 ANSWER ✔✔ballsPresent()
Question: 5
Why does a programmer indent their code?
COPYRIGHT©NINJANERD 2025/2026. YEAR PUBLISHED 2025. COMPANY REGISTRATION NUMBER: 619652435. TERMS OF USE. PRIVACY
3
STATEMENT. ALL RIGHTS RESERVED