Variables & Assignments
Data Abstraction and Lists
Conditionals and Booleans
Iteration
Procedures
100

A named abstraction that stores a value.

What is a variable?

100

An ordered sequence of elements.

What is a list?

100

A value that can only be true or false. 

What is a Boolean?

100

A loop that repeats until a condition becomes true. 

What is REPEAT UNTIL?

100

A named group of instructions that may have parameters.

What is a procedure?

200

x ← 4

y ← x + 3

x ← 10

DISPLAY(y)

What value is displayed?

What is 7?

200

nums ← [4, 8, 12]

DISPLAY(nums[1])

What value is displayed?

What is 4?

200

This programming construct allows a program to choose between different actions based on whether a Boolean expression is true or false.

What is a conditional (IF statement)?

200

An algorithm uses this construct when it repeats a set of steps either a fixed number of times or until a Boolean condition becomes true.

What is iteration?

200

What is the argument for the procedure mystery?

PROCEDURE mystery(n)  

     RETURN(n + n)

DISPLAY(mystery(6))

What is 6?

300

The operator used to assign a value to a variable in AP pseudocode.

What is ← ?

300

The position used to access an element in a list.

What is an index?

300

The logical operator that is true only when both conditions are true.

What is AND?

300

sum ← 0

REPEAT 3 TIMES  

     sum ← sum + 2

END REPEAT

DISPLAY(sum)

What is 6?

300

PROCEDURE mystery(n)  

     RETURN(n + n)

DISPLAY(mystery(6))

What value is displayed?

What is 12?

400

a ← 5

b ← a

a ← 10

DISPLAY(b)

What is 5?

400

nums ← [10, 20, 30]

DISPLAY(nums[2])

What is 20?

400

IF (x > 10)  

     DISPLAY("High")

ELSE  

     DISPLAY("Low")

What is a conditional?

400

count ← 0

REPEAT 5 TIMES  

     count ← count + 2

END REPEAT

DISPLAY(count)

What will be displayed by the end of this code?

What is 10?

400

PROCEDURE greet()  

     RETURN("Hello")

message ← greet()

DISPLAY(message)

What value is stored in message?

What is "Hello"?

500

x ← 3

x ← x + 2

x ← x * 4

What is the final value of x?

What is 20?

500

scores ← [5, 7, 9, 11]

APPEND(scores, 13)

DISPLAY(LENGTH(scores))


What is 5?

500

x ← 8


IF (x > 5 AND x < 10)  

     DISPLAY("A") 

ELSE  

     DISPLAY("B")

What is "A"?

500

x ← 1


REPEAT UNTIL (x > 16)  

     x ← x * 2

END REPEAT

How many times does the loop body execute?

What is 5 times?

500

PROCEDURE subtract(a, b)  

     RETURN(a - b)


DISPLAY(subtract(10, 3))

What value is displayed?

What is 7?

M
e
n
u