AP CSP Big Idea 3 - Ahnaf Yasin

0.0(0)
studied byStudied by 7 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/34

flashcard set

Earn XP

Description and Tags

AP CSP Flashcard Showdown – Big Idea 3 is a game designed to help players master key concepts from Big Idea 3: Algorithms and Programming in preparation for the AP CSP exam. The game can be played solo or with a partner. To begin, open the Knowt flashcard set titled "AP CSP Big Idea 3 – Ahnaf Yasin." In solo mode, go through each flashcard, awarding yourself 1 point for every correct answer. If you answer incorrectly, review the concept and retry that card at the end. In two-player mode, one player acts as the quizmaster while the other is the challenger. The quizmaster reads the term or question, and the challenger has 10 seconds to respond. Each correct answer earns 1 point. After 10 cards, players switch roles. For an extra challenge, add a Bonus Round: select 5 random cards, and if a player answers all 5 correctly, they receive a 3-point bonus. In two-player mode, the player with the most points at the end is crowned the CSP Flashcard Champion.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

35 Terms

1
New cards

In the code 'average = num1 + num2 + num3 / 3', what is the error?

Parentheses are missing around the sum of num1, num2, and num3.

2
New cards

What is the output of the following code snippet: x = 10; if x > 5: if x < 15: print('A') else: print('B')

A

3
New cards

Why would a programmer use a procedure?

To break code into reusable, manageable parts.

4
New cards

Which Boolean expression is equivalent to 'not (A or B)'?

'not A and not B'

5
New cards

What will be the output of the following code: x = 3, y = 4, x, y = y, x, print(x, y)?

4 3

6
New cards

A list L contains 5 elements. Which of the following will cause an error when accessing the list? L[4], L[-1], L[5], or L[0]?

L[5]

7
New cards

What is the best reason to use a loop in programming?

To repeat code efficiently.

8
New cards

Describe the process of a binary search.

Repeatedly divides the search interval in half.

9
New cards

Which control structure is not typically used to implement an algorithm?

Declaration

10
New cards

What will the following code print: for i in range(3): for j in range(2): print(i, j)?

0 0, 0 1, 1 0, 1 1, 2 0, 2 1

11
New cards

Which data type is most appropriate to store a list of hourly recorded temperatures?

List

12
New cards

What will the following function output: def mystery(x): return x * x; print(mystery(5))?

25

13
New cards

In programming, what is abstraction?

Removing unnecessary details.

14
New cards

Which of the following will reverse a list called myList?

myList.reverse()

15
New cards

Give an example of an event-driven programming construct.

onClick handler

16
New cards

How does an algorithm function?

Step-by-step procedure.

17
New cards

What is NOT a benefit of using procedures?

Slower execution

18
New cards

What does len([1, 2, 3, 4]) return?

4

19
New cards

What is the result of 'True and False or True'?

True

20
New cards

Which algorithm has the best average-case time complexity for searching in a sorted list?

Binary search

21
New cards

What will be the output of the following code snippet: x = [1, 2, 3], y = x, y.append(4), print(x)?

[1, 2, 3, 4]

22
New cards

What will the following code output: print('3' + '4')?

34

23
New cards

Which of the following would evaluate to True: not (True or False), True and False, not False, or False or False?

not False

24
New cards

Which algorithm would be best for checking if a number is prime?

Trial division up to sqrt(n)

25
New cards

Which of the following is not a programming construct: Sequence, Selection, Iteration, or Estimation?

Estimation

26
New cards

Which two features improve code readability?

Meaningful variable names and Proper indentation

27
New cards

Which of the following are types of iteration:

for loop and while loop

28
New cards

Which two issues may arise from poor algorithm design?

Inefficiency and Bugs

29
New cards

Which of the following can be abstracted into procedures?

Repeated tasks and Complex calculations

30
New cards

What are two characteristics of good algorithms?

Precise and Efficient

31
New cards

Describe what happens when a list is passed to a function and modified inside that function.

The original list is affected.

32
New cards

Explain why abstraction is important in programming.

It manages complexity and improves clarity.

33
New cards

Define what is an algorithm.

A set of steps to solve a problem.

34
New cards

What is the difference between a loop and a conditional statement?

A loop repeats; conditionals make decisions.

35
New cards

How does a procedure help reduce redundancy?

It avoids repeating code.