PROGLANG FINAL

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

1/103

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:17 PM on 5/25/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

104 Terms

1
New cards

Control structure

It is a fundamental component that determines the flow of execution of instructions in a program. It governs which instructions are executed, when, and under what conditions.

2
New cards

Control structure

It allows programs to make decisions, perform repeated tasks, and respond dynamically to different inputs or conditions—essential for building complex, responsive software.

3
New cards

Sequential Structure

This is the simplest form of control where statements or instructions are executed one after another in the exact order in which they are written.

4
New cards

does not

Sequential structure is used to carry out a linear set of operations where the flow (does / does not) require any decision-making or repetition.

5
New cards

fixed sequence

Sequential structure is commonly applied in tasks that must be performed in a f______ s__________ with no deviation

6
New cards

Sequential Structure

This control structure is common in initialization routines, data input/output operations, and procedural steps.

7
New cards

Selection (Decision-Making) Structure

This executes a block of code only if a condition is true. It allows the program to choose between alternative paths of execution based on whether a condition is true or false. This enables decision-making capabilities in the program.

8
New cards

Selection (Decision-Making) Structure

This is commonly applied in scenarios requiring branching logic, such as validation checks, menu selections, or rule-based execution (e.g., user authentication and eligibility determination).

9
New cards

branching logic

Selection (Decision-Making) Structure is commonly applied in scenarios requiring b____________ l_______

10
New cards

Selection (Decision-Making) Structure

User authentication and eligibility determination is an example of which control structure?

11
New cards

If-else and if-elif-else

Selection (Decision-Making) Structure use the following keyword:

12
New cards

if

This keyword is used to begin a conditional block that runs if the condition is true

13
New cards

else

This keyword is used to execute its block if the condition is false.

14
New cards

elif

This keyword is short of “else if”

15
New cards

elif

This keyword is used to evaluate additional conditions if previous ones are false.

16
New cards

Iteration (Looping) Structure

This repeats a block of code as long as a specified condition is true. It is used to automate repetitive tasks without manual code duplication.

17
New cards

Iteration (Looping) Structure

It promotes efficiency and reduces errors by encapsulating repeat logic.

18
New cards

Iteration (Looping) Structure

This is commonly applied in traversing data structures, generating reports, implementing counters, or processing batches

19
New cards

Iteration (Looping) Structure

Looping through user records and retry mechanisms is an example of which control structure?

20
New cards

for and while

Iteration (Looping) Structure uses the following keyword:

21
New cards

for

This keyword begins the counting loop.

22
New cards

while

This keyword begins a loop that continues as long as the condition is true.

23
New cards

break, continue, return

Jump (Branching) Structure alters the flow explicitly using b____, c_________, r________, etc.

24
New cards

Jump (Branching) Structure

It interrupts or redirects the normal flow of control using statements that cause execution to jump to another part of the code.

25
New cards

loops, iterations, function

Jump (Branching) Structure provides exceptional flow control, particularly in exiting l______ early, skipping i____________, or terminating a f________.

26
New cards

break, continue

These keywords are used in loop control

27
New cards

return

This keyword is used in early function termination

28
New cards

error-handling, system-level

Jump (Branching) Structure is used in specific e_______ h_________ and s________ l_______operations (e.g., skipping invalid entries, exiting on critical errors).

29
New cards

break

This keyword terminates the loop immediately.

30
New cards

continue

This keyword is used to skip the current loop iteration and proceed to the next.

31
New cards

Subprogram

It is a named, self-contained block of code designed to execute a specific task within a larger program.

32
New cards

functions, procedures, or methods

It is also known as f___________, p___________, or m__________(depending on the language).

33
New cards

Subprogram

It allows programmers to group logically related operations and execute them whenever needed.

34
New cards

def

Subprograms are declared using the d___ keyword followed by a function name, a parameter list, and a block of statements.

35
New cards

Subprogram

These are fundamental constructs in all modern programming languages.

36
New cards

divide-and-conquer

Subprograms support the d_______ and c__________ approach by allowing a program to be decomposed into manageable units, which improves clarity, debugging, collaboration, and reuse.

37
New cards

Modularity

The main purpose of subprograms is to promote m__________.

38
New cards

Modularity

It is the process of breaking down a program into smaller, functional components.

39
New cards

understand and maintain

Code is easier to u__________ and m__________ because each subprogram handles a specific task.

40
New cards

once

Redundancy is reduced since frequently used operations can be written o____ and called many times.

41
New cards

isolated and verified

Testing and debugging are more efficient, as subprograms can be i__________ and v_______ independently.

42
New cards

smoother

Collaboration becomes s__________ since development teams can assign different subprograms to different members.

43
New cards

Mathematical Computation

Subprograms for operations like finding the square root, computing factorials, or evaluating mathematical expressions.

44
New cards

Data Handling

Functions for data validation, parsing, formatting, and transformation.

45
New cards

User Interface (UI)

Subprograms that handle events like button clicks, form submissions, or rendering interface components.

46
New cards

Web Development

Backend functions to process requests, interact with databases, and return responses to the user.

47
New cards

Software Application Programming Interface (API)

Subprograms expose functionality for external programs to reuse, like authentication, logging, or payment processing.

48
New cards

Game Development

Control mechanics such as character movement, score tracking, and level progression are often subprogram-based.

49
New cards

functions

Subprograms are implemented primarily through f_________.

50
New cards

value, arguments

Subprograms may or may not return v______ and can accept various a__________, including default, keyword, and variable-length parameters.

51
New cards

Parameter passing

It determines how arguments are transmitted from the caller to the subprogram.

52
New cards

Parameter passing

It affects whether modifications made inside the subprogram reflect outside and influences memory management and performance.

53
New cards

Pass-by-object-reference

Python uses a mechanism called "____ __ _______ ___________" (a mix of pass-by-value and pass-by-reference depending on mutability).

54
New cards

Pass-by-Value

Copies the value of the actual parameter. Changes in the function do not affect the original.

55
New cards

Pass-by-Value

Simulated with immutable types

56
New cards

Pass-by-Reference

Passes a reference (address) of the argument. Changes affect the original.

57
New cards

Pass-by-Reference

Simulated with mutable types

58
New cards

Pass-by-Result

A parameter acts like a placeholder to be filled with a result and returned.

59
New cards

Pass-by-Result

Not directly supported

60
New cards

Pass-by-Value-Result

Value is copied in, and the result is copied out after function execution.

61
New cards

Pass-by-Value-Result

Not natively supported

62
New cards

Pass-by-Value

Demonstrates that changes to parameters inside the function do not affect the original variable.

63
New cards

original data

Pass-by-Value is useful when protecting the o________ d_____ from unintended side effects.

64
New cards

immutable

Python integers are i____________, so num inside the function is a copy of x's value. This mimics pass-by-value.

65
New cards

Pass-by-Reference

Demonstrates how changes to a parameter inside a function affect the original variable when the parameter is mutable.

66
New cards

lists or dictionaries

Pass-by-Reference is useful for modifying data structures like l____ or d___________.

67
New cards

mutable

Since lists are m_________, Python passes a reference to the list, so operations inside the function apply to the original data.

68
New cards

Pass-by-Result (Simulated)

Illustrates how a function might assign a result to an initially empty or placeholder variable and return it. While Python does not support true pass-by-result, the behavior can be simulated by returning the result explicitly.

69
New cards

Pass-by-Value-Result (Simulated)

Mimics is a mechanism where a copy of the value is passed into the function, modified internally, and the updated result is explicitly returned and reassigned to the original.

70
New cards

reassigned

Pass-by-Value-Result (Simulated) is suitable when internal processing should not affect the original unless explicitly r_________.

71
New cards

Yes

Does Pass-by-Value support data protection?

72
New cards

No

Does Pass-by-Value allow data mutation?

73
New cards

original variables

Pass-by-Value Use Case: Protect o________ v___________

74
New cards

No

Does Pass-by-Reference support data protection?

75
New cards

Yes

Does Pass-by-Reference allow data mutation?

76
New cards

place

Pass-by-Reference Use Case: Modify caller’s data in p______

77
New cards

Yes

Does Pass-by-Result support data protection?

78
New cards

Yes (output only)

Does Pass-by-Result allow data mutation?

79
New cards

generated or computed

Pass-by-Result Use Case: Return g___________ or c___________ results

80
New cards

Yes (initially)

Does Pass-by-Value-Result support data protection?

81
New cards

Yes (reassigned)

Does Pass-by-Value-Result allow data mutation?

82
New cards

side-effects

Pass-by-Value-Result Use Case: Controlled s___ e_______

83
New cards

Call stack

When a subprogram is called, it must allocate memory to store its local variables, parameters, return address, and bookkeeping information. This allocation typically occurs in a region of memory called the c____ s______.

84
New cards

Call stack

is a system-managed data structure that tracks active subprogram calls during execution. activation record (or stack frame)

85
New cards

Stack Frame

Another term for activation record.

86
New cards

Parameter, Local Variable, Return Address

An activation record includes the following:

87
New cards

Parameters

These are passed to the subprogram

88
New cards

Local variables

These are declared inside the subprogram

89
New cards

Return address

(where to resume after the subprogram ends)

90
New cards

popped

When the subprogram completes, its activation record is p________ from the stack, and all memory associated with it is released.

91
New cards

Static Allocation and Stack-Dynamic Allocation

There are two (2) primary strategies for allocating local variables:

92
New cards

when and how

Static Allocation and Stack-Dynamic Allocation affect w___ and h____ long variables exist in memory and how subprograms can reuse or preserve data across multiple calls.

93
New cards

Stack-Dynamic Variables

These are local variables allocated at runtime when the subprogram is called.

94
New cards

execution

Stack-Dynamic Variables memory exists only during the e________ of that specific call. Once the subprogram returns, the variables are discarded, and subsequent calls will reinitialize them.

95
New cards

Stack-Dynamic Variables

This behavior is the default in Python and most modern programming languages.

96
New cards

recursion and concurrent

Stack-Dynamic Variables allows each call to a subprogram to have its own independent set of variables, which is essential for r_________ and c_________ function execution.

97
New cards

Memory Management

Automatic deallocation of local variables prevents memory leaks.

98
New cards

Recursion

Recursive functions rely on the stack to track each invocation's local state.

99
New cards

Data Isolation

Variables in different calls do not interfere with each other unless passed explicitly.

100
New cards

Performance

Stack allocation is fast due to the last-in, first-out (LIFO) nature of the call stack.