Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

AP CSAP Lists

Total questions: 20

Worksheet time: 36mins

Name
Class
Date
1.
What is the word used to describe repetition in programming?
a)
Sequence
b)
Selection
c)
Iteration
d)
Coding
2.

What does this code do?

a)

Moves forward 1 time

b)

Moves forward forever

c)

Moves forward 5 times

d)

Moves left

3.

What shape does this code make?

a)

Rectangle

b)

Triangle

c)

Square

d)

Circle

4.

For this scenario related to turtle/robot drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task:


Drawing a hexagon (six-sided shape)

a)

Loop

b)

Function

5.

For this scenario related to turtle/robot drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task:


Drawing out the letters of a word "HELLO"

a)

Loop

b)

Function

6.

For this scenario related to turtle/robot drawing, indicate whether it is better to write a loop or a function (or a set of functions) to handle the task:


Drawing 100 tiny dots in a line.

a)

Loop

b)

Function

7.

What is a possible output when the following code segment executes? The ending position of the turtle is shown in each diagram. The starting position is shown as a white triangle in cases where the turtle starts and ends in different locations.

a)
b)
c)
d)
e)
8.

A Boolean expression is an expression that evaluates to which of the of the following?

a)

Yes/Maybe/No

b)

True/False

c)

Any Integer

d)

Integers between 1 and 10

e)

Any single character

9.
a)
b)
c)
d)
e)
10.

Which of the following is true about while loops ?

a)

While loops terminate after a fixed number of loops that is pre-determined

b)

While loops terminate after a fixed number of loops that is determined after the loop executes once.

c)

While loops run as long as a given boolean condition is true.

d)

While loops run as long as a given boolean condition is false.

e)

While loops are known as "forever loops" and never stop until the program is halted by the user.

Answer

11.

Which vocabulary word is:

a common method for referencing the elements in a list or string using numbers

a)

list

b)

element

c)

index

12.

Which vocabulary word is:

an ordered collection of elements

a)

list

b)

element

c)

index

13.

Which vocabulary word is:

an individual value in a list that is assigned a unique index

a)

list

b)

element

c)

index

14.

Match the index with the value.


var myNumbers = [32, 64, 33, 0, 15, 26, 3]

myNumbers[4]

a)

64

b)

15

c)

0

d)

32

15.

//Consider this code:

var list = [10, 12, 14, 16, 18];

appendItem(list, 3);

insertItem(list, 2, 20);

removeItem(list, 0);


//What is printed to the console?

console.log(list);

a)

10, 12, 14, 16, 18

b)

10, 12, 14 , 20, 16, 18, 3

c)

3, 12, 14, 20, 16, 18

d)

12, 20, 14, 16, 18, 3

16.

//Consider this code:

var list = [10, 12, 14, 16, 18];

appendItem(list, 3);

insertItem(list, 2, 20);

removeItem(list, 0);


//What is printed to the console?

console.log(list[0]);

(a)  

17.

//Consider this code:

var list = [10, 12, 14, 16, 18];

appendItem(list, 3);

insertItem(list, 2, 20);

removeItem(list, 0);


//What is printed to the console?

console.log(list.length);

(a)  

18.

//Consider this code:

var list = [10, 12, 14, 16, 18];

appendItem(list, 3);

insertItem(list, 2, 20);

removeItem(list, 0);


//What is printed to the console?

console.log(list[list.length-1]);

(a)  

19.

//Consider this code.


var beginning = "My name is ";

var end = "Mrs. Anderson";

var sentence = beginning + end;


//What is printed to the console?

console.log(sentence.length);

a)

name

b)

name is

c)

y name

d)

23

e)

n

20.
a)

4

b)

7

c)

9

d)

10

e)

ab