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

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

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

Question 5
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 6
college-boardComputer Science PrinciplesAPExam Style
1 mark

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

Question 7
college-boardComputer Science PrinciplesAPExam Style
1 mark

Which type of control structure would you use to execute one set of code when a variable equals 10 and another set when it does not?

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

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

Question 9
college-boardComputer Science PrinciplesAPExam Style
1 mark

What will be the output if the following pseudocode is executed?

IF (age > 18) THEN PRINT "Adult"
ELSE PRINT "Minor"
END IF
Question 10
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'