1/29
Flashcards for AP Computer Science Principles Big Idea 3: Algorithms and Programming
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Variable
An abstraction inside a program that can hold a value. It has associated data storage representing one value at a time, but that value can be a list or other collection that contains multiple values.
Data Types
Represented using variables; include numbers, Booleans, lists, and strings.
Assignment Operator
Allows a program to change the value represented by a variable.
List
An ordered sequence of elements, e.g., [value1, value2, value3, …]
Element
An individual value in a list that is assigned a unique index.
Index
A common method for referencing the elements in a list or string using natural numbers.
String
An ordered sequence of characters.
Data Abstraction
Provides a separation between the abstract properties of a data type and the concrete details of its representation; manages complexity by giving a collection of data a name without referencing specific details.
Algorithm
A finite set of instructions that accomplish a specific task.
Sequencing
The application of each step of an algorithm in the order in which the code statements are given.
Code Statement
A part of program code that expresses an action to be carried out.
Expression
Can consist of a value, a variable, an operator, or a procedure call that returns a value.
Arithmetic Operators
Include addition, subtraction, multiplication, division, and modulus operators.
String Concatenation
Joins together two or more strings end-to-end to make a new string.
Substring
Part of an existing string.
Boolean Value
Either true or false.
Relational Operators
Used to test the relationship between two variables, expressions, or values (=, ≠, >, <, ≥, ≤).
Logical Operators
NOT, AND, and OR, which evaluate to a Boolean value.
Selection
Determines which parts of an algorithm are executed based on a condition being true or false.
Conditional Statements
Or “if-statements,” affect the sequential flow of control by executing different statements based on the value of a Boolean expression.
Nested Conditional Statements
Consist of conditional statements within conditional statements.
Iteration
A repeating portion of an algorithm; repeats a specified number of times or until a given condition is met.
Infinite Loop
Occurs in REPEAT UNTIL iteration when the ending condition will never evaluate to true.
Procedure
A named group of programming instructions that may have parameters and return values (also referred to as method or function).
Parameters
Input variables of a procedure.
Arguments
Specify the values of the parameters when a procedure is called.
Procedural Abstraction
Provides a name for a process and allows a procedure to be used only knowing what it does, not how it does it.
Modularity
The subdivision of a computer program into separate subprograms.
Software Library
Contains procedures that may be used in creating new programs.
Simulation
Abstractions of more complex objects or phenomena for a specific purpose.