CHAPTER 7 - Expressions and Assignment Statements

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

1/70

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 9:02 AM on 5/18/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

71 Terms

1
New cards

Expression

Combination of operators and operands that produces a value.

2
New cards

Operand

Data item manipulated by an operator.

3
New cards

Operator

Symbol representing an operation. Example: +, -, *

4
New cards

Unary Operator

Operator requiring one operand. Example: -x

5
New cards

Binary Operator

Operator requiring two operands. Example: a + b

6
New cards

Ternary Operator

Operator requiring three operands. Example: condition ? x : y

7
New cards

Operator Precedence

Rules determining order of operation evaluation.

8
New cards

Associativity

Rules determining evaluation direction when operators have same precedence.

9
New cards

Left Associativity

Evaluation from left to right. Example: a - b - c

10
New cards

Right Associativity

Evaluation from right to left. Example: Assignment operators.

11
New cards

Order of Evaluation

Sequence in which operands are evaluated.

12
New cards

Side Effect

Change in program state during expression evaluation. Example: Modifying global variable.

13
New cards

Functional Side Effect

Function changes data outside itself while computing.

14
New cards

Lazy Evaluation

Expression evaluated only when needed.

15
New cards

Eager Evaluation

Expression evaluated immediately.

16
New cards

Operator Overloading

Giving multiple meanings to an operator. Example: + for numbers and strings.

17
New cards

Coercion

Implicit type conversion. Example: Integer automatically converted to float.

18
New cards

Cast

Explicit type conversion by programmer. Example: (float)x

19
New cards

Relational Expression

Expression comparing values. Example: x > y

20
New cards

Boolean Expression

Expression producing true or false.

21
New cards

Short-Circuit Evaluation

Stopping evaluation once result is already determined.

22
New cards

Assignment Statement

Statement assigning value to variable.

23
New cards

Assignment as Expression

Assignment producing a value usable inside another expression.

24
New cards

Multiple Assignment

Assigning same value to multiple variables. Example: x = y = z = 0

25
New cards

Conditional Target

Assignment target chosen conditionally.

26
New cards

Mixed-Mode Assignment

Assignment involving different data types.

27
New cards

Loss of Precision

Information loss during type conversion. Example: Assigning float to integer.

28
New cards

Imperative Computation

Program execution through state changes using assignments.

29
New cards

Control Structure

Statement controlling execution flow along with the statements it manages.

30
New cards

Selection Statement

Control structure choosing among alternatives.

31
New cards

Two-Way Selection

Selection between two paths. Example: if-else.

32
New cards

if Statement

Executes statements based on condition truth.

33
New cards

Nested if Statement

if statement placed inside another if.

34
New cards

Dangling Else Problem

Ambiguity about which if matches an else clause.

35
New cards

Multiple-Way Selection

Selection among many alternatives. Example: switch-case.

36
New cards

switch Statement

Control structure selecting execution path based on expression value.

37
New cards

case Clause

Branch inside switch statement.

38
New cards

default Clause

Branch executed when no cases match.

39
New cards

Iterative Statement

Control structure performing repeated execution.

40
New cards

Counter-Controlled Loop

Loop managed by a counter variable. Example: for loop.

41
New cards

for Loop

Loop with initialization, condition, and update components.

42
New cards

Loop Counter

Variable tracking loop repetitions.

43
New cards

Logically Controlled Loop

Loop controlled by Boolean expression.

44
New cards

Pretest Loop

Loop checking condition before body execution. Example: while.

45
New cards

while Loop

Pretest loop executing while condition remains true.

46
New cards

Posttest Loop

Loop checking condition after body execution. Example: do-while.

47
New cards

do-while Loop

Loop guaranteed to execute at least once.

48
New cards

Infinite Loop

Loop that never terminates.

49
New cards

Loop Body

Statements repeatedly executed in a loop.

50
New cards

Loop Initialization

Initial setup before loop execution.

51
New cards

Loop Update

Statement modifying loop control variable.

52
New cards

User-Located Loop Control

Programmer-controlled transfer within loop using statements like break and continue.

53
New cards

break Statement

Immediately exits loop or switch.

54
New cards

continue Statement

Skips remaining loop body and proceeds to next iteration.

55
New cards

foreach Loop

Loop iterating directly through collection elements.

56
New cards

Data-Structure Iteration

Iterating through arrays, lists, or collections.

57
New cards

goto Statement

Unconditional branch to labeled statement.

58
New cards

Unconditional Branching

Transfer of control without condition checking.

59
New cards

Spaghetti Code

Confusing and tangled program flow caused by excessive branching.

60
New cards

Loop Condition

Expression determining whether loop continues.

61
New cards

Nested Loop

Loop placed inside another loop.

62
New cards

Control Expression

Expression deciding control structure behavior.

63
New cards

Boolean-Controlled Iteration

Repetition based on Boolean condition.

64
New cards

Selection Control Expression

Expression used in if or switch statements.

65
New cards

Multiple Entry Control Structure

Structure allowing several entry points, often discouraged.

66
New cards

Loop Termination

Process of ending loop execution.

67
New cards

Menu-Driven Program

Program repeatedly showing menu options, commonly using posttest loops.

68
New cards

Traversal

Visiting all elements of a collection.

69
New cards

Readable Control Structure

Control structure easy to understand and maintain.

70
New cards

Structured Programming

Programming style emphasizing clear, predictable control flow.

71
New cards

Unstructured Programming

Programming style using excessive goto statements causing confusion.