Module 2 CE Computer Fundamentals Programming 31 64-2-31
Module 2 CE Computer Fundamentals Programming 31 64-2-31
32
• Cookbook
• Recipe Booklet
• Choreography
Example
of
Flowchart
Notations Used in Flowchart
46
Notation Meaning
: comparison
& logical and
Y yes
N no
EOF End of File
Relational Test Operators
47
Notation Meaning
> is greater than
< is less than
<= or =< is less than or equal to
>= or => is greater than or equal to
<> or >< is not equal to
= is equal to
Arithmetic Operators
48
Notations Meaning
+ Addition
- Subtraction
* Multiplication
/ Division
() Grouping
** or ^ Exponentiation
Precedence of the Operators
49
1. Grouping ()
2. Exponentiation
3. Multiplication or division
4. Addition or subtraction
When operators are all of equal priority, the
computer evaluate the expression from left
to right.
50
When operators are of different priorities, the
computer performs those operations with higher
priorities first
51
Operations enclosed in parentheses will take place
before other operations. Note (if there are multiple
parentheses, the innermost parenthesis will be
52
evaluated first).
Write clearly the computation desired
53
Example #2.3
2L / 3G
Answer?
( 2 * L ) / (3 * G )
Problem 6 and 7
54
59
Problem 9 and 10
60
Age Charge
<16 7
>=16 and <65 10
>=65 5