wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

AP CSP Exam Reference Sheet Practie

Total questions: 25

Worksheet time: 13mins

Name
Class
Date
1.

What does the DISPLAY expression do?

a)

Displays the value of expression, followed by a space.

b)

Accepts a value from the user and returns the input value.

c)

Evaluates expression and then assigns a copy of the result to the variable a.

d)

Generates and returns a random integer from a to b, including a and b.

2.

What does the MOD operator do?

a)

The code in block of statements is repeated until the Boolean expression condition evaluates to true.

b)

Evaluates to the remainder when a is divided by b.

c)

The code in block of statements is executed n times.

d)

Assigns a copy of the list bList to the list aList.

3.

What does the relational operator = do?

a)

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.

b)

Tests the relationship between two variables, expressions, or values.

c)

Evaluates to true if both conditionl and condition2 are true; otherwise evaluates false.

d)

Evaluates to true if condition is false; otherwise evaluates to false.

4.

What does the REPEAT UNTIL (condition) do?

a)

Evaluates to the number of elements in aList.

b)

The code in block of statements is repeated until the Boolean expression condition evaluates to true.

c)

The code in block of statements is executed n times.

d)

The variable item is assigned the value of each element of aList sequentially, in order, from the first element to the last element.

5.

What does the INSERT (aList, i, value) do?

a)

The length of the list is increased by 1, and value is placed at index i in aList.

b)

Assigns the value of aList[i] to the variable x.

c)

The length of aList is increased by 1, and value is placed at the end of aList.

d)

Removes the item at index i in aList and shifts to the left any values at indices greater than i.

6.

What does the PROCEDURE procName (parameter1, parameter2, ...) do?

a)

Defines procName as a procedure that takes zero or more arguments.

b)

The robot moves one square forward in the direction it is facing.

c)

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.

d)

The robot rotates in place 90 degrees clockwise.

7.

What does the RETURN (expression) do?

a)

The robot moves one square forward in the direction it is facing.

b)

Returns the flow of control to the point where the procedure was called and returns the value of expression.

c)

The robot rotates in place 90 degrees counterclockwise.

d)

The robot rotates in place 90 degrees clockwise.

8.

What does the ROTATE_RIGHT() do?

a)

The robot rotates in place 90 degrees clockwise.

b)

The robot rotates in place 90 degrees counterclockwise.

c)

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.

d)

The robot moves one square forward in the direction it is facing.

9.

What does the CAN_MOVE (direction) do?

a)

The robot rotates in place 90 degrees clockwise.

b)

The robot moves one square forward in the direction it is facing.

c)

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.

d)

The robot rotates in place 90 degrees counterclockwise.

10.

What does the FOR EACH item IN aList do?

a)

The variable item is assigned the value of each element of aList sequentially, in order, from the first element to the last element.

b)

The robot rotates in place 90 degrees clockwise.

c)

The robot rotates in place 90 degrees counterclockwise.

d)

The robot moves one square forward in the direction it is facing.

11.

What is the JavaScript equivalent to ← in the AP CSP Exam Language?

a)

=

b)

==

c)

!=

d)

>=

12.

What is the JavaScript equivalent to AND in the AP CSP Exam Language?

a)

||

b)

&&

c)

!

13.

What is the equivalent to a while loop in the AP CSP Exam Language?

a)

REPEAT n TIMES

b)

REPEAT UNTIL

c)

CONTINUE n TIMES

d)

WHILE UNTIL

14.

What does the following code do: aList ← [value1, value2, value3, ...]

a)

Creates a list

b)

Creates a block

c)

Creates 3 different variables

15.

What does the following code do: x ← aList[i]

a)

Assigns the value x to aList[i]

b)

Erases the value of aList[i]

c)

renames aList[i]

d)

Assigns the value of aList[i] to x

16.

Look at the following code. What does this look like in JavaScript?

a)

a loop

b)

a function

c)

an if statement

17.

How do you write a return statement in the AP CS exam language?

a)

return expression;

b)

Return expression;

c)

RETURN(expression)

18.
  1. How do you obtain the length of an array in the AP CS exam language?

a)

aList.length

b)

aList.length()

c)

LENGTH(aList);

d)

LENGTH(aList)

19.
  1. Suppose the code DISPLAY(hello) is written. What will this do?

a)

display hello

b)

return hello

20.

How do you obtain user input in the AP CS Exam Language?

a)

readLine

b)

readInt

c)

INPUT( )

d)

input( )

21.

What is the JavaScript equivalent to ≠ in the AP CSP Exam Language?

a)

=

b)

==

c)

!=

d)

!==

22.

What is the JavaScript equivalent to ≥ in the AP CS Exam Language?

a)

b)

>

c)

>=

d)

=<

23.

What is the JavaScript equivalent to ≤ in the AP CS Exam Language?

a)

b)

<

c)

<=

d)

=<

24.

What does MOD calculate in the AP CSP Exam Language?

a)

division

b)

multiplication

c)

remainder

d)

product

25.

What will the block of code evaluate to if condition is false?

a)

true

b)

false