Expressions
CONCEPT: Expressions are formulae made from variables and operators, e.g. calculator operations:
+, -, *, /, ^
- weeks = days / 7 divide value of days by 7
- grossPay = hours * rate multiply the two values
-
Fundamental rule of assignment
The expression is evaluated before the assignment is made
- score = score + 3
Computing is NOT algebra: Though = is used in assignment statements, it means “becomes” whereas in algebra it means equality. So, score = score + 3 is essential to computing, but meaningless in algebra