AP Computer Science Principles Exam Review

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

1/21

flashcard set

Earn XP

Description and Tags

Flashcards reviewing key concepts for the AP Computer Science Principles exam, focusing on program design, algorithm development, error handling, and data abstraction.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

22 Terms

1
New cards

What is the purpose of a computing innovation according to CRD-2.A?

To explain what the innovation is intended to do and how it benefits users.

2
New cards

According to CRD-2.B, what should you explain about a program or code segment?

Discuss the step-by-step operations of your program or a specific part of your code.

3
New cards

What does CRD-2.C ask you to identify?

List the data or user inputs your program requires to function.

4
New cards

What does CRD-2.D ask you to identify?

Describe what your program returns or displays after processing inputs.

5
New cards

According to CRD-2.E, what should you outline about program development?

Outline the steps you took in planning, coding, and testing your program.

6
New cards

What aspects of program design are covered by CRD-2.F?

Explain how you designed the user interface and the considerations for user interactions.

7
New cards

What is the focus of CRD-2.G regarding code segments or programs?

Write comments or documentation that clarifies what a code segment does.

8
New cards

How are relational operators used in decision-making within a program, according to AAP-2.E.b?

They are used to compare values and guide program flow based on conditions, such as ensuring valid input.

9
New cards

How are logical operators used in code, according to AAP-2.F.b?

Logical operators like 'and' combine multiple conditions to validate inputs or control program behavior; 'or' and 'not' can also be used for multiple acceptable inputs or to reject invalid inputs.

10
New cards

According to AAP-2.H.b, how do conditional statements control program flow?

Conditional statements control the flow based on user input. For example, when typing READY, the program will take you to the menu.

11
New cards

How does the described loop function (AAP-2.J)?

The loop repeatedly asks the user to select an item, adding it to the order and updating the total price if the input is valid, until the user types 'DONE'.

12
New cards

According to AAP-2.K.b, what is the side effect of loops regarding user input?

Each valid item entered by the user is added to the order and contributes to the total price and if the input is invalid, the loop ensures the user is prompted to enter a valid choice.

13
New cards

According to AAP-2.L, how might different algorithms affect the outcome or efficiency?

Different algorithms can yield the same result but operate at different speeds; efficiency changes based on the algorithm used.

14
New cards

What general steps were taken to create the taco ordering algorithm (AAP-2.M.a)?

First, menu items and prices were defined, then the user was prompted to start. After this, the program allowed item selection and showed the completed order and total cost.

15
New cards

How were algorithms combined in the taco ordering program (AAP-2.M.b)?

User input validation and total price calculation algorithms were combined by adapting a simple input-checking algorithm and integrating a pricing calculation algorithm.

16
New cards

According to CRD-2.I.a, what is the error?

The error in the provided code is that the item input check does not handle all possible valid cases properly, specifically when a user enters a number outside the valid range (1–13) or something that is not a number.

17
New cards

According to CRD-2.I.b, how to correct error?

Use a try-except block to handle non-numeric inputs, ensuring that the user gets a proper message even if they enter something that isn’t a number.

18
New cards

According to CRD-2.J, how to test code with input and checked program

If I type 1, 2, then DONE, it should show “Birria Taco” and “Pastor Taco” with a total of $6.14. Another test is picking 9 and 11, which should give me “Water” and “Sour Cream” and the total should be $1.98. If I get these results, then I know my code is working right.

19
New cards

How are lists used to simplify managing collections of data (AAP-1.D.a)?

Lists store collections of tacos, drinks, extras, and their prices, making it easier to manage, access, and update related data without repetition.

20
New cards

According to AAP-1.D.b, how does the use of data abstraction manage complexity in program code?

Using lists and dictionaries helps organize data making the code simpler, cleaner, and easier to change or update.

21
New cards

How is the order list processed in a loop and what happens during and after (AAP-2.O.b)?

The order list is processed in a loop to calculate the total price. After the loop completes, the total price is displayed based on the items selected by the user and the list traversal ensures that every item in the order is accounted for in the final total.

22
New cards

How does the place_order() function help manage complexity (AAP-3.B)?

The place_order() function helps manage complexity by handling all the ordering steps in one place which makes the code easier to understand and modify because each part of the program is separated into smaller sections.