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

Algorithms & Programming Fundamentals

Question 1
college-boardComputer Science PrinciplesAPExam Style
1 mark

What combination of boolean operators can replace * such that ((X∗Y)∗Z)((X * Y) * Z)((X∗Y)∗Z) returns false only when a single variable among X,Y,ZX, Y, ZX,Y,Z is true?

Question 2
college-boardComputer Science PrinciplesAPExam Style
1 mark

What truth value does !(X == Y) return if X and Y have identical boolean values?

Question 3
college-boardComputer Science PrinciplesAPExam Style
1 mark

What is the result of the Boolean expression (true || false) && !(false || false)?

Question 4
college-boardComputer Science PrinciplesAPExam Style
1 mark

In a conditional statement, which replacement for '???' would make the code segment below always execute its body?

python
if (???): 
    # Code body executes here 
Question 5
college-boardComputer Science PrinciplesAPExam Style
1 mark

Which Boolean expression correctly determines if a number 'n' is odd?

Question 6
college-boardComputer Science PrinciplesAPExam Style
1 mark

In evaluating two search algorithms for efficiency where one algorithm uses sequential search and another uses binary search on sorted data sets, what will most significantly impact their performance difference?

Question 7
college-boardComputer Science PrinciplesAPExam Style
1 mark

Select the correct outcome when evaluating (!(A && B) && (A || B)) given that A is false and B is true.

Feedback stars icon

How are we doing?

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

Question 8
college-boardComputer Science PrinciplesAPExam Style
1 mark

What will the following code snippet print? x = 10 y = 5 print(x != y)

Question 9
college-boardComputer Science PrinciplesAPExam Style
1 mark

In a conditional statement, what value must a boolean expression return for an 'else' block to execute?

Question 10
college-boardComputer Science PrinciplesAPExam Style
1 mark

What is an example of applying abstraction when dealing with boolean logic?