NEW
Font size
WorksheetsAP CSP Exam Reference Sheet Practie
Total questions: 25
Worksheet time: 13mins
What does the DISPLAY expression do?
Displays the value of expression, followed by a space.
Accepts a value from the user and returns the input value.
Evaluates expression and then assigns a copy of the result to the variable a.
Generates and returns a random integer from a to b, including a and b.
What does the MOD operator do?
The code in block of statements is repeated until the Boolean expression condition evaluates to true.
Evaluates to the remainder when a is divided by b.
The code in block of statements is executed n times.
Assigns a copy of the list bList to the list aList.
What does the relational operator = do?
The code in block of statements is executed if the Boolean expression condition evaluates to true; no action is taken if condition evaluates to false.
Tests the relationship between two variables, expressions, or values.
Evaluates to true if both conditionl and condition2 are true; otherwise evaluates false.
Evaluates to true if condition is false; otherwise evaluates to false.
What does the REPEAT UNTIL (condition) do?
Evaluates to the number of elements in aList.
The code in block of statements is repeated until the Boolean expression condition evaluates to true.
The code in block of statements is executed n times.
The variable item is assigned the value of each element of aList sequentially, in order, from the first element to the last element.
What does the INSERT (aList, i, value) do?
The length of the list is increased by 1, and value is placed at index i in aList.
Assigns the value of aList[i] to the variable x.
The length of aList is increased by 1, and value is placed at the end of aList.
Removes the item at index i in aList and shifts to the left any values at indices greater than i.
What does the PROCEDURE procName (parameter1, parameter2, ...) do?
Defines procName as a procedure that takes zero or more arguments.
The robot moves one square forward in the direction it is facing.
Evaluates to true if there is an open square one square in the direction relative to where the robot is facing; otherwise evaluates to false.
The robot rotates in place 90 degrees clockwise.
What does the RETURN (expression) do?
The robot moves one square forward in the direction it is facing.
Returns the flow of control to the point where the procedure was called and returns the value of expression.
The robot rotates in place 90 degrees counterclockwise.
The robot rotates in place 90 degrees clockwise.
What does the ROTATE_RIGHT() do?
The robot rotates in place 90 degrees clockwise.
The robot rotates in place 90 degrees counterclockwise.
Evaluates to true if there is an open square one square in the direction relative to where the robot is facing; otherwise evaluates to false.
The robot moves one square forward in the direction it is facing.
What does the CAN_MOVE (direction) do?
The robot rotates in place 90 degrees clockwise.
The robot moves one square forward in the direction it is facing.
Evaluates to true if there is an open square one square in the direction relative to where the robot is facing; otherwise evaluates to false.
The robot rotates in place 90 degrees counterclockwise.
What does the FOR EACH item IN aList do?
The variable item is assigned the value of each element of aList sequentially, in order, from the first element to the last element.
The robot rotates in place 90 degrees clockwise.
The robot rotates in place 90 degrees counterclockwise.
The robot moves one square forward in the direction it is facing.
What is the JavaScript equivalent to ← in the AP CSP Exam Language?
=
==
!=
>=
What is the JavaScript equivalent to AND in the AP CSP Exam Language?
||
&&
!
What is the equivalent to a while loop in the AP CSP Exam Language?
REPEAT n TIMES
REPEAT UNTIL
CONTINUE n TIMES
WHILE UNTIL
What does the following code do: aList ← [value1, value2, value3, ...]
Creates a list
Creates a block
Creates 3 different variables
What does the following code do: x ← aList[i]
Assigns the value x to aList[i]
Erases the value of aList[i]
renames aList[i]
Assigns the value of aList[i] to x
Look at the following code. What does this look like in JavaScript?
a loop
a function
an if statement
How do you write a return statement in the AP CS exam language?
return expression;
Return expression;
RETURN(expression)
How do you obtain the length of an array in the AP CS exam language?
aList.length
aList.length()
LENGTH(aList);
LENGTH(aList)
Suppose the code DISPLAY(hello) is written. What will this do?
display hello
return hello
How do you obtain user input in the AP CS Exam Language?
readLine
readInt
INPUT( )
input( )
What is the JavaScript equivalent to ≠ in the AP CSP Exam Language?
=
==
!=
!==
What is the JavaScript equivalent to ≥ in the AP CS Exam Language?
≥
>
>=
=<
What is the JavaScript equivalent to ≤ in the AP CS Exam Language?
≤
<
<=
=<
What does MOD calculate in the AP CSP Exam Language?
division
multiplication
remainder
product
What will the block of code evaluate to if condition is false?
true
false
