
AP CSP Standard 1 Review
Authored by Kelly Challand
Computers
12th Grade
Used 13+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
26 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following cannot be used as a valid condition in an if statement for Karel?
ballsPresent()
frontIsClear()
leftIsBlocked()
putBall()
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Karel starts at a location with one tennis ball. Consider the following code:
for (var i = 0; i < 3; i++) {
if (ballsPresent()) {
takeBall();
} else {
putBall();
putBall();
}
}
After the loop completes, how many tennis balls will be at Karel's starting location?
0
1
2
6
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Karel starts at Street 2, Avenue 1, facing East in a 5x5 world. Carefully observe the sequence of commands below:
move();
putBall();
move();
move();
move();
move();
move();
After executing all the commands, where will Karel end up, or what will happen?
Karel will end on Street 1, Avenue 2
Karel will end on Street 1, Avenue 7
This code won’t run because of a syntax error
Karel will crash into a wall
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which condition should be placed in the while loop so that Karel continues picking up tennis balls until there are none left at the current location?
while (________) {
takeBall();
noBallsPresent()
ballsPresent()
frontIsClear()
takeBall()
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What are the main reasons programmers indent their code?
Easier for other people to understand.
A key part of good programming style!
Helps show the structure of the code.
All of the above
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to teach Karel new commands so it can perform custom tasks?
Define a new function
While loop
For loop
The Start function
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Karel needs to place exactly 300 tennis balls in a row. Which programming control structure would be most efficient and appropriate for this task?
Nested while loop
For loop
While loop
If Statement
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?