zuai-logo
zuai-logo
  1. AP Computer Science Principles
FlashcardFlashcardStudy GuideStudy GuideQuestion BankQuestion Bank
GlossaryGlossary

Algorithms & Programming Fundamentals

Question 1
Computer Science PrinciplesAPConcept Practice
1 mark

What is the value of the variable 'x' after the following pseudocode is executed?

pseudocode
x ← 10
Question 2
Computer Science PrinciplesAPConcept Practice
1 mark

What is the value of y after the following code is executed?

pseudocode
x ← 5
y ← x + 3
x ← 2
Question 3
Computer Science PrinciplesAPConcept Practice
1 mark

Given the list myList ← [5, 10, 15, 20], what value does myList[1] represent?

Question 4
Computer Science PrinciplesAPConcept Practice
1 mark

What is the content of numbers after executing the following pseudocode?

pseudocode
numbers ← [1, 2, 3]
INSERT(numbers, 2, 4)
Question 5
Computer Science PrinciplesAPConcept Practice
1 mark

What is the result of the expression 15 MOD 4?

Question 6
Computer Science PrinciplesAPConcept Practice
1 mark

What is the result of the expression "hello" + " " + "world"?

Question 7
Computer Science PrinciplesAPConcept Practice
1 mark

If x ← true and y ← false, what is the result of NOT y?

Feedback stars icon

How are we doing?

Give us your feedback and let us know how we can improve

Question 8
Computer Science PrinciplesAPConcept Practice
1 mark

What is printed after the following code is executed?

pseudocode
x ← 7
IF x > 10
    DISPLAY("Large")
ELSE
    DISPLAY("Small")
Question 9
Computer Science PrinciplesAPConcept Practice
1 mark

Consider the following code:

pseudocode
x ← 5
y ← 10
IF x > 2
    IF y < 15
        DISPLAY("Both conditions met")
    ELSE
        DISPLAY("Only outer condition met")
ELSE
    DISPLAY("No condition met")

What will be displayed?

Question 10
Computer Science PrinciplesAPConcept Practice
1 mark

How many times will the following loop execute?

pseudocode
REPEAT 8 TIMES
    DISPLAY("Hello")