PART 1
Getting Started
Comparing data by using
Boolean expressions
Using arithmetic to modify the content of variables is a kind of data manipulation.
To determine the effect of data manipulation, a computer must compare the cur-
rent state of the variable against its original state or the state of a known value. In
some cases, detecting the status of one input against another is also necessary. All
these operations check the relationship between two variables, so the resulting
operators are relational operators, as shown in Table 4-5.
Sometimes a relational operator can’t tell the whole story of the comparison of
two values. For example, you might need to check a condition in which two sepa-
rate comparisons are needed, such as
MyAge > 40
and
MyHeight < 74
. The need
to add conditions to the comparison requires a logical operator of the sort shown
in Table 4-6.
Do'stlaringiz bilan baham: |