COMP 1125: Principles of Programming - Comprehensive Course Review

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/46

flashcard set

Earn XP

Description and Tags

Vocabulary practice flashcards covering fundamental computer science topics, including arrays, computer architecture, functions, decision structures, and repetition structures from COMP 1125.

47 Terms

1
New cards

Array

A single data structure that holds multiple values of the same type stored contiguously in memory, tracked by the address of its first element.

2
New cards

Element

An individual value stored within an array.

3
New cards

Array Index

A zero-based numerical position corresponding to an element's location in an array.

4
New cards

Subscript

Bracket notation applied to an array variable (also called indexing into the array) used to access or reassign specific elements.

5
New cards

Range-Based for Loop

A loop introduced in C++ 11 (also called a for-each or enhanced for loop) that iterates directly over the values of an array rather than their index positions.

6
New cards

Central Processing Unit (CPU)

The hardware component responsible for executing programs; it houses the control unit and the arithmetic and logic unit (ALU).

7
New cards

Main Memory (RAM)

Fast, expensive, volatile memory where programs and data currently being executed must reside for quick access by the CPU.

8
New cards

Secondary Storage

Non-volatile, relatively inexpensive storage designed to hold data for long periods without power, such as disk drives, SSDs, and flash drives.

9
New cards

Byte

A unit of computer storage consisting of 8 bits, capable of holding a small number or a single letter.

10
New cards

Kilobyte (KB)

A unit of digital memory consisting of 2102^{10} bytes, which is equal to 81928192 bits.

11
New cards

Two's Complement

A binary storage method used to represent negative numbers in computers, conceptualized as having an extra leading sign bit.

12
New cards

Floating Point Technique

A computer technique used to store numbers with fractional decimal parts by separating binary components across a decimal point.

13
New cards

ASCII

American Standard Code for Information Interchange; a set of 128 numeric codes used to represent English letters, punctuation marks, and other characters.

14
New cards

Top Down Design

A programming methodology that involves breaking down a complicated task into smaller and smaller pieces until each piece is manageable.

15
New cards

Pseudocode

A syntax-free, mock-up version of a program used in program design that is not meant to be compiled or executed.

16
New cards

Preprocessor Directive

A statement starting with a pound sign (#), such as #include, instructing the preprocessor to replace directives with code from specified library files before compilation.

17
New cards

Garbage Data

Unpredictable leftover bit patterns found at a variable's memory address when declared inside a function without explicit initialization.

18
New cards

Named Constant

A variable declared with the const keyword that represents a fixed value that cannot be altered after initialization.

19
New cards

Magic Number

An unexplained, literal numeric value appearing directly in source code that can cause confusion during maintenance.

20
New cards

Type Casting

The explicit process of converting or treating a value of one data type as another data type, such as using static_cast.

21
New cards

Widening Conversion

A type conversion converting a smaller data type to a larger data type without the risk of data loss.

22
New cards

Modular Programming

A programming approach where large programs are divided into individual, self-contained functions that can be combined to solve complex problems.

23
New cards

Function Header

The opening part of a function definition containing its return type, function name, and parameter list.

24
New cards

Function Signature

The combination of a function's name and its parameter list.

25
New cards

void Function

A function that performs a task but does not return a value back to the calling statement.

26
New cards

Parameter

A variable declared in a function header's parameter list that is local to the function and receives input data from outside.

27
New cards

Argument

The actual value or expression passed into a function when it is called to initialize the function's parameter.

28
New cards

Function Prototype

A function header declaration placed before main() or other calling code that allows functions to be defined in any physical order.

29
New cards

Pass By Value

The default argument-passing mechanism where a copy of the argument value is delivered to the function, preventing modifications to the original caller variable.

30
New cards

Pass By Reference

An argument-passing mechanism using the ampersand (&) operator that passes the actual memory address, allowing the function to modify the caller's variable.

31
New cards

Boolean Expression

An expression evaluated to either true (1) or false (0), commonly formed using relational and logical operators.

32
New cards

Compound Boolean Expression

An expression created by linking two or more Boolean expressions together using logical operators such as && (and) or || (or).

33
New cards

Short Circuit Evaluation

A process where C++ skips evaluating the second sub-expression of a logical operator when the first operand suffices to determine the final result.

34
New cards

Single Alternative Decision Structure

A decision structure, such as an if statement, that provides only a single alternative path of execution if a condition is met.

35
New cards

Dual Alternative Decision Structure

A decision structure, such as an if-else statement, providing two separate execution paths: one if true, and another if false.

36
New cards

Switch Statement

A multi-branch decision structure that matches an integer-compatible expression against constant expression cases, typically terminating branches with break.

37
New cards

Scope

The region or boundaries of a program where a declared variable is recognized and accessible.

38
New cards

getline() Function

A standard C++ function that accepts an input stream and target string variable to capture a full line of user input, including whitespace.

39
New cards

Repetition Structure

A control structure (commonly called a loop) that enables the program to execute a block of code multiple times.

40
New cards

Iteration

A single full execution of the body of code contained within a loop.

41
New cards

Infinite Loop

A loop containing a condition that never becomes false, forcing the repetition to run indefinitely unless interrupted by an external action.

42
New cards

Pretest Loop

A loop (such as a while or for loop) where the controlling Boolean expression is evaluated prior to executing each iteration.

43
New cards

Posttest Loop

A loop (such as a do-while loop) that executes its loop body at least once before testing the controlling condition.

44
New cards

Augmented Assignment Operators

Shortcut operators (such as +=, -=, *=) that update the existing value of a variable relative to itself.

45
New cards

Accumulator Variable

A variable that maintains a running total by being augmented during each successive iteration of a loop.

46
New cards

Sentinel Value

A special, predefined value used as a flag to terminate a loop, intentionally chosen because it cannot be mistaken for valid input.

47
New cards

continue Statement

A jump statement inside a loop body that causes the remainder of the current iteration to be skipped, immediately progressing to the next iteration.