Programming Fundamentals (Lectures 1–8)

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

1/56

flashcard set

Earn XP

Description and Tags

Comprehensive vocabulary review flashcards covering problem solving, algorithms, C syntax, data types, formatted I/O, operators, control flow, decision making, iterative structures, arrays, and assessment policies across Lectures 1 through 8.

57 Terms

1
New cards

Program

A set of instructions or code written in a specific programming language designed to perform a specific task, solve problems, or achieve particular goals when executed by a computer.

2
New cards

Computational Problem

A problem that specifies a well-defined input-output relationship, detailing what the input looks like and what output should be produced for each input.

3
New cards

Algorithm

A well-defined computational procedure that takes some value or set of values as input and produces some value or set of values as output, satisfying requirements of correctness and efficiency.

4
New cards

NP-complete Problems

A class of computational problems for which no efficient solution is currently known, leading developers to seek efficient algorithms that yield good approximate solutions rather than optimal ones.

5
New cards

Algorithm Efficiency

A metric determined by the execution speed and memory consumption of an algorithm; for example, insertion sort runs roughly proportional to c1n2c_1 n^2 time, whereas merge sort runs in c2n lg(n)c_2 n \text{ lg}(n) time and performs faster on large input sizes.

6
New cards

Syntax Error

An error that violates the grammatical rules and structural conventions of a programming language, caught by the compiler and preventing program execution.

7
New cards

Runtime Error

An error—also known as an exception—that does not appear until program execution begins, indicating that an unexpected failure or illegal operation occurred while the program was running.

8
New cards

Semantic Error

A logic error in which the code runs successfully without generating compiler or system error messages, but produces incorrect results because the program executes what the programmer coded rather than what was intended.

9
New cards

Imperative Programming Paradigm

A programming paradigm derived from the Latin 'impero' ('I command') where the programmer instructs the computer with a sequence of step-by-step commands that modify program state and variables in a specific order.

<p>A programming paradigm derived from the Latin 'impero' ('I command') where the programmer instructs the computer with a sequence of step-by-step commands that modify program state and variables in a specific order.</p>
10
New cards

Procedural Programming

A sub-branch of imperative programming that organizes instructions into modular units called procedures, functions, or subroutines to handle complex operations and provide clear visibility into application states.

11
New cards

Compiler

A system program that translates an entire high-level source code program into machine-executable binary code all at once, generating a standalone output file such as a .exe.

12
New cards

Interpreter

A program that reads, translates, and executes high-level source code line by line without saving permanent object code or generating an executable file.

13
New cards

Integrated Development Environment (IDE)

A comprehensive software application combining source code editing, building, debugging, and packaging tools into a single user-friendly graphical interface to enhance developer productivity.

14
New cards

TDM-GCC

The Windows distribution of the GNU Compiler Collection (GCC) integrated into the Dev-C++ IDE to compile and execute C and C++ programs.

15
New cards

Preprocessor Directive

An instruction beginning with a hash symbol (#) that instructs the preprocessor to process source code before compilation begins, such as including header files (#include) or defining macros (#define).

16
New cards

main() Function

The designated entry point of execution present in every standard C program; declaring it as int main() specifies that it returns an integer status code to the operating system upon termination.

17
New cards

return 0

A statement at the conclusion of the main function that returns a zero value to the operating system, signaling that the program has executed and terminated successfully without errors.

18
New cards

Variable

A named location in computer memory with a specific data type and size, capable of holding values that can be read, manipulated, and overwritten during program execution.

19
New cards

Primary Data Types

The fundamental built-in data types provided by C, including int, char, float, double, and void, which directly determine memory allocation and interpretation of stored values.

20
New cards

Derived Data Types

Data types formed by combining or referencing primitive types, categorized in C as arrays, references, and pointers.

21
New cards

User-Defined Data Types

Custom composite data types declared and structured by the programmer to model complex data, specifically structures (struct), unions (union), and enumerations (enum).

22
New cards

Variable Initialization

The practice of declaring a variable and assigning it an initial starting value in a single program statement (e.g., int count = 0;).

23
New cards

Format Specifier

A formatted character sequence preceded by a percent sign (%) used in I/O functions like printf and scanf to dictate how input and output data should be interpreted and displayed (e.g., %d for integers, %f for floats).

24
New cards

printf() Function

A standard C library function declared in stdio.h used to write formatted output to the standard console display based on specified format specifiers and string literals.

25
New cards

scanf() Function

A standard C library function declared in stdio.h used to parse formatted text input from the keyboard and store the parsed values into variable addresses specified using format specifiers.

26
New cards

Address-of Operator (&)

A unary operator used before a variable identifier in functions such as scanf to pass the exact memory address where incoming user data should be stored.

27
New cards

Buffer Overflow

A vulnerability occurring when user input exceeds the allocated storage capacity of a target memory block (e.g., reading an unbounded string via scanf("%s", name); into a fixed-length array).

28
New cards

Operator

A symbol, character, or keyword in a programming language that specifies a specific operation or action to be carried out on one or more operands.

29
New cards

Operand

An individual data item, variable, constant, or expression that is acted upon or evaluated by an operator.

30
New cards

Modulo Operator (%)

An arithmetic operator that divides the first integer operand by the second integer operand and returns the integer remainder.

31
New cards

Unary Operator

An operator that acts on only a single operand, such as prefix/postfix increment (++), decrement (--), unary plus/minus (+/-), logical NOT (!), bitwise NOT (~), or the sizeof operator.

32
New cards

Binary Operator

An operator that requires two operands to perform an action, encompassing arithmetic (+, -, *, /, %), relational (

33
New cards

Ternary Operator (?:)

A conditional operator that takes three operands using the syntax (condition) ? expression1 : expression2; functioning as a concise inline alternative to an if…else statement.

<p>A conditional operator that takes three operands using the syntax (condition) ? expression1 : expression2; functioning as a concise inline alternative to an if…else statement.</p>
34
New cards

Logical Operators

Operators that evaluate Boolean conditions and return 1 (true) or 0 (false), consisting of logical AND (&&), logical OR (||), and logical NOT (!).

35
New cards

Compound Statement

A sequence of declarations and statements grouped inside a pair of matching curly braces {} to form a single executable block of code.

36
New cards

Operator Precedence

The established priority hierarchy determining the exact evaluation sequence of operators within complex expressions that lack overriding parentheses (e.g., multiplication evaluated prior to addition).

37
New cards

Control Flow

The precise chronological order in which individual statements, instructions, or function calls are executed or evaluated in a running program.

38
New cards

if Statement

A fundamental single-selection control structure that evaluates a Boolean test expression and executes an associated block of statements only if the condition evaluates to non-zero (true).

39
New cards

if…else Statement

A double-selection control structure that executes one specific block of code when a test expression evaluates to true, and an alternate block when it evaluates to false.

40
New cards

switch Statement

A multiple-selection control structure that tests an expression against a list of constant integer or character case labels and branches execution to the matching case block.

41
New cards

default Keyword

An optional label within a switch statement that designates the fallback block of code to be executed when none of the explicit case constants match the evaluated expression.

42
New cards

break Statement

A jump statement that causes an immediate exit from the innermost enclosing switch statement, for loop, while loop, or do…while loop, resuming execution at the first line following the construct.

43
New cards

Counter-Controlled Repetition

A definite looping pattern in which the exact number of iterations is known in advance, regulated by a dedicated loop counter variable, an initial value, an increment/decrement step, and a termination condition.

44
New cards

Sentinel-Controlled Repetition

An indefinite looping pattern where repetition proceeds until a designated special value (sentinel value) is encountered in the input stream, signaling the end of data entry.

45
New cards

Entry-Controlled Loop

A loop construct (also called a pretest loop), such as the for or while loop, that evaluates its continuation condition prior to executing the loop body; if the condition is initially false, the body does not execute.

<p>A loop construct (also called a pretest loop), such as the for or while loop, that evaluates its continuation condition prior to executing the loop body; if the condition is initially false, the body does not execute.</p>
46
New cards

Exit-Controlled Loop

A loop construct (also called a post-test loop), represented by the do…while loop, that tests the continuation condition after the loop body executes, guaranteeing execution at least once.

47
New cards

for Loop

A structured pretest loop featuring a header that consolidates loop variable initialization, loop continuation condition, and update expressions into one line separated by semicolons.

48
New cards

while Loop

A pretest loop statement that continues executing its body block repeatedly as long as its controlling conditional expression evaluates to true.

49
New cards

do…while Loop

A post-test loop repetition structure using the format do { … } while (condition); where statement execution precedes condition checking and terminates with a required semicolon.

50
New cards

Nested Loop

A loop placed entirely within the body of an outer loop, requiring the complete set of inner loop iterations to execute for each individual iteration of the outer loop.

51
New cards

continue Statement

A jump statement that skips the remaining statements in the current iteration of an enclosing loop and transfers execution directly to the next iteration's update or condition evaluation.

52
New cards

Array

A data structure consisting of a contiguous collection of memory locations of fixed size that store multiple elements of the identical data type under a shared identifier name.

53
New cards

Array Index

A zero-based integer subscript enclosed in square brackets used to directly designate and access the exact positional element of an array, spanning from 0 to n−1n - 1 for an array of size nn.

<p>A zero-based integer subscript enclosed in square brackets used to directly designate and access the exact positional element of an array, spanning from 0 to $$n - 1$$ for an array of size $$n$$.</p>
54
New cards

Array Size Declarator

A positive integer constant enclosed within square brackets during array declaration that explicitly defines the fixed number of elements the compiler must allocate in memory.

55
New cards

Contiguous Memory Allocation

A memory allocation layout where elements of an array are stored adjacent to one another in unbroken physical memory addresses, allowing the array name to represent the base address of the first element.

56
New cards

Two-Dimensional Array (2D Array)

An array of arrays structured as a grid or matrix composed of rows and columns, where each element is indexed by two successive subscripts indicating its row and column position (e.g., matrix[row][col]).

<p>An array of arrays structured as a grid or matrix composed of rows and columns, where each element is indexed by two successive subscripts indicating its row and column position (e.g., matrix[row][col]).</p>
57
New cards

Midterm Examination

A milestone academic assessment scheduled during the 8th week of the course designed to evaluate CLO-1 (accounting for 52.6% or 20 marks of CLO-1) and CLO-2 (accounting for 32.3% or 10 marks of CLO-2).