ICT-reviewer Grade 8
ICT-reviewer Grade 8
VARIABLES
CONSTANT
- Constant are values that do not change during the execution of the
program.
Operators and Expressions
Operators
- These are symbols that indicate the operation to be performed.
Classification of Operators
I. ARITHMETIC OPERATORS
These are used to perform mathematical calculations.
Expressions
- In computer science, an expression is a syntactic entity in a programming
language that may be evaluated to determine its value. It is a combination of
one or more constants, variables, functions, and operators that the
programming language interprets (according to its particular rules of
precedence and of association) and computes to produce ("to return", in a
stateful environment) another value. This process, for mathematical
expressions, is called evaluation.
Order of Precedence
- Also called as “order of operations” or “operator of precedence”, is a set of
rules specifying which procedures should be performed first in a
mathematical expression
Constructive and Destructive variables
Destructive Variables
- variable that destroys or change its value after processing. This
type of variable is normally the temporary storage of data during
processing.
Constructive Variables
- variable that maintains its value after being used in the process.
Example:
Question: Suppose that we have variables A and B and the values of A
and B are 5 and 10 respectively. What will happen if we have an
instruction of A = B? What is now the value of A? What is the value of A
and B after performing the instruction? Who gets what data?
- Variable A has now the same value with variable B, 10, and the
original data of variable A, 5 was destroyed. This is what we mean
by destructive and constructive variables. Variable A is the
destructive variable and Variable B is the constructive variable.
- As a rule, the manner of transferring data from one variable to
another is always from right to left.