100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

1.21.1 Introduction to Programming 2025/2026 Exam Questions Marking Scheme New Update | A+ Rated

Rating
-
Sold
-
Pages
18
Grade
A+
Uploaded on
24-04-2025
Written in
2024/2025

1.21.1 Introduction to Programming 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 -

Show more Read less
Institution
Programming
Course
Programming










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Programming
Course
Programming

Document information

Uploaded on
April 24, 2025
Number of pages
18
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

1.21.1 Introduction to Programming
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

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
NinjaNerd Liberty University
View profile
Follow You need to be logged in order to follow users or courses
Sold
230
Member since
1 year
Number of followers
5
Documents
12796
Last sold
1 day ago
NinjaNerd

Here You will All Documents and Package Deals Offered by Seller NinjaNerd.

3.6

39 reviews

5
15
4
7
3
9
2
3
1
5

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions