Big Idea 3-Algorithms and Programming Flashcards
A _______is an abstraction inside a program that can hold a value. Each _______ has associated data storage that represents one value at a time, but that value can be a list or other collection that in turn contains multiple values.
variable
Using _________ variable names helps with the readability of program code and understanding of what values are represented by the variables.
meaningful
Some programming languages provide types to represent data, which are referenced using variables. These types include ___________________.
numbers, Booleans, lists, and strings
A _______ is an ordered sequence of elements. For example, [value1, value2, value3, …] describes a ________ where value1 is the first element, value2 is the second element, value3 is the third element, and so on.
Warning! AP Exam starts index at 1.
list
An ________ is an individual value in a list that is assigned a unique index.
element
An _______ is a common method for referencing the elements in a list or string using natural numbers.
index
A _______ is an ordered sequence of characters.
string
________ provides a separation between the abstract properties of a data type and the concrete details of its representation.
Data abstraction
Data abstractions manage _______ in programs by giving a collection of data a name without referencing the specific details of the representation.
complexity
Data abstractions can be created using _______.
lists
Developing a data abstraction to implement in a program can result in a program that is easier to __________.
develop and maintain
The use of ______ allows multiple related items to be treated as a single value.
lists
An _______ is a finite set of instructions that accomplish a specific task.
algorithm
Algorithms executed by programs are implemented using __________.
programming languages
Every algorithm can be constructed using combinations of ________, _________, and _______.
sequencing, selection, and iteration.
_________ is the application of each step of an algorithm in the order in which the code statements are given.
Sequencing
A __________ is a part of program code that expresses an action to be carried out.
code statement
An _________ can consist of a value, a variable, an operator, or a procedure call that returns a value.
expression
Expressions are evaluated to produce a ________.
single value
True or False: Sequential statements execute in the order they appear in the code segment.
True
Comment: Clarity and readability are important considerations when expressing an algorithm in a programming language.
Arithmetic operators are part of most programming languages and include _______, _______, _______, _______, and _______ operators.
addition, subtraction, multiplication, division, and modulus
Comment: The exam reference sheet provides a MOD b, which evaluates to the remainder when a is divided by b.
Assume that a is an integer greater than or equal to 0 and b is an integer greater than 0. For example, 17 MOD 5 evaluates to ___.
2
__________ joins together two or more strings end-to-end to make a new string.
String concatenation
A _________ is part of an existing string.
substring
A ______ is either true or false.
Boolean value
_______ determines which parts of an algorithm are executed based on a condition being true or false.
Selection
_______________ affect the sequential flow of control by executing different statements based on the value of a Boolean expression.
Conditional statements, or “if-statements,”