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

Algorithms & Programming Fundamentals

Question 1
college-boardComputer Science PrinciplesAPExam Style
1 mark

In a situation where the program's outcome must adapt to user input in real-time, which programming structure is most effective for handling such conditions?

Question 2
college-boardComputer Science PrinciplesAPExam Style
1 mark

What is the purpose of selection statements in programming?

Question 3
college-boardComputer Science PrinciplesAPExam Style
1 mark

What is the purpose of the condition in an if statement?

Question 4
college-boardComputer Science PrinciplesAPExam Style
1 mark

When designing a game in which a player's move is only valid if they have not previously occupied that space, which data structure would effectively track these moves?

Question 5
college-boardComputer Science PrinciplesAPExam Style
1 mark

When designing algorithm involving use recursion includes base case series recursive calls involves branching based different conditions how does choice affect scalability solution?

Question 6
college-boardComputer Science PrinciplesAPExam Style
1 mark

When creating unit tests for an application's error handling routine based on varying levels of user permissions and inputs, which advanced technique could best detect incorrect privilege escalations or access controls?

Question 7
college-boardComputer Science PrinciplesAPExam Style
1 mark

What happens in an if-else statement if the initial 'if' condition evaluates as 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

Susie wrote an algorithm with an if-else statement that assigns 'Fail' to result if score <60 otherwise 'Pass', which line contains an error?

python
if(score<60):
    result = 'Fail'
else:
    result = 'Pass'
Question 9
college-boardComputer Science PrinciplesAPExam Style
1 mark

Which part of an if-else statement is executed when the condition is false?

Question 10
college-boardComputer Science PrinciplesAPExam Style
1 mark

What does the "if" keyword represent in most programming languages?