|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
v |
Computers
must be told what value to assign to
|
|
|
variables,
using an assignment statement such as
|
|
|
|
averageOverClass = 21.14
|
|
|
|
mayor = “Paul Schell”
|
|
|
v |
The
general form of an assignment statement is
|
|
|
|
<variable
name> <assignment symbol> <expression>
|
|
|
|
o |
Languages
use different assignment symbols:
= :=
¬
|
|
|
o |
Read
assignment as “is assigned”, or “becomes” or “gets”
|
|
|
|
o |
All
three components must always be present
|
|
|
v |
Fundamental
property of assignment
|
|
|
|
The
“flow” of information is always right-to-left
|
|
|
|
o |
destination = source
|
|
|
|
o |
changedVariable = value
|
|