1/33
Vocabulary flashcards covering repetition structures, functions, modular programming, and arrays based on COMP 1125: Principles of Programming.
Repetition Structures
Control structures, more commonly known as loops, that allow specific blocks of code to repeat multiple times.
Iteration
A single execution of the block of code that composes a loop.
Condition-Controlled Loop
A category of loops (including while and do-while loops) that repeats as long as a specified condition evaluates to true.
Count-Controlled Loop
A loop (such as a for loop) best utilized when the exact number of iterations is known before execution begins.
Pretest Loop
A loop type, such as the while loop, where the controlling condition is evaluated before any loop code executes.
Posttest Loop
A loop type, specifically the do-while loop, where the body executes first and the condition is evaluated afterward to determine if it should run again.
Infinite Loop
A loop whose condition remains perpetually true and never evaluates to false, requiring an outside action to stop execution.
Augmented Assignment Operators
Shorthand programming operators (such as += or *=) used to update the value of a variable relative to its current value.
Increment and Decrement Operators
Special unary operators (++ and --) that increase or decrease a variable's value by 1.
Loop Header
The top statement of a for loop that typically contains where to start (initialization), where to stop (condition), and how to advance (update).
Running Total
A cumulative sum maintained across loop iterations, such as a partial sum in a mathematical summation.
Accumulator Variable
A variable that is augmented during each iteration of a loop to track a running total.
Sentinel Value
A predetermined flag value entered to signal the termination of a loop, selected because it is unlikely to be mistaken for legitimate data.
Nested Loops
A structure where one loop resides inside another; the inner loop executes in its entirety for each individual iteration of the outer loop.
break Keyword
A control statement used to immediately terminate and exit the execution of a loop.
continue Keyword
A control statement used to bypass the remainder of the current iteration and advance directly to the loop's next iteration.
String Index
The zero-based numerical position of a character within a string, accessed using bracket syntax.
Modular Programming
A development approach rooted in top-down design that breaks a complex problem into smaller tasks, implementing each task as a distinct function.
Function
A named, reusable block of code designed to solve a specific subtask, which can be defined once and called wherever needed.
Function Header
The declaration line of a function that specifies its return type, function name, and parameter list.
Function Signature
The combination of a function's name and its parameter list.
void Function
A function that performs an action but does not return a value to the caller.
Parameter
A local variable declared within a function header's parameter list that receives incoming values when the function is called.
Argument
The actual value passed into a function call to initialize its corresponding parameter.
Function Prototype
A function declaration placed before its use (typically near the top of the file) that enables functions to be called regardless of their definition order.
Pass By Value
The default parameter passing mechanism where a copy of an argument's value is passed into the function, meaning changes made inside do not alter the caller's variable.
Pass By Reference
A parameter passing mechanism using the address-of operator (&) to pass the memory address of the actual variable, causing changes inside the function to alter the variable outside.
Array
A contiguous sequence of values in memory of identical data type that can be referenced using a single variable name.
Element (Array)
An individual value stored within an array structure.
Subscripts
The bracket notation ([]) and index used to access or reassign specific values within an array.
Contiguous Memory
The consecutive arrangement in physical memory where an array's elements are placed sequentially back-to-back.
Range-Based for Loop
A loop construct introduced in C++ 11 (also referred to as a for-each loop or enhanced for loop) that iterates directly over array values instead of element indices.
Incomplete Initialization
Providing fewer initializers than the declared array size, which fills the uninitialized elements with default values (such as 0 for ints or empty strings for strings) rather than garbage values.
Bounds Checking
A safety feature verifying that index accesses stay within an array's valid bounds, which is not performed by standard C++ arrays.