Basic Paradigms for Control Flow
(T/F)
Details in syntax and semantics do not differ between languages.
False
Seven Categories for Control Flow
Describe Sequencing.
Statements are to be executed in a particular order, usually in the order appearing in the program text.
Define Selection.
Describe Iteration.
Describe Procedural Abstraction.
A potentially complex collection of control constructs is encapsulated so that it can be treated as a single unit, often subject to parameterization.
Describe Recursion.
Describe Non-Determinacy.
Define Concurrency.
Sequencing
Imperative VS Functional Languages
Recursion
Imperative VS Functional Languages
Iteration
Imperative VS Functional Languages
Precedence Associativity

Assignments

Construct Side Effects

Value Model of Variables

Reference Model

Boxing in Java

Multiway Assignment

What are some advantages to Initialization?
Ordering Within Expressions
(a + b) * (c + d)
f (a+b, c+d)
Which will be evaluated first? (a + b) or (c + d)
Not determined by precedence or associativity rules

Order Within Expressions

C, C++ define “sequence points” that constrain order of evaluation. What happens between sequence points?

Evaluation Between Sequence Points in C:
Assume x has value 1 before the expression
x[i] = i++ + 1;
What happens?
Undefined—both outcomes below are allowed
x[i] = i++ + 1;
x[1] = 2, i==2
x[2] = 2, i==2
Instead use
x[i] = i+1;
i++;