Professional Documents
Culture Documents
FLOWCHART
1. System flowchart – this type of flowchart illustrates which data is used and
how it interacts with the hardware and the user.
2. Program flowchart – which illustrates graphically the logical sequence of the
program.
The flowchart can help us to view the relationships between the two or more
parts and subparts of the program. How they relate or interact to each other. Moreover,
it improves the clarity of our logical thoughts, since we had seen its relationships to
each other in graphical form. The computer program involves the three basic main
operations:
INPUT
PROCESS
INPUT
The basic flowcharting symbols are given below:
Initialization/Preparation Symbol
Guidelines in drawing a flowchart:
Start
Ask “Is it
raining today?”
Yes Is it No
raining?
Start
ALGORITHMS (Pseudocodes)
Mathematical Operators
+ Addition
- Subtraction
* Multiplication
/ Division
% Modulus
^ Exponent
Relational Operators
Logical Operators
AND or &&
OR or ‖
NOT or !!
Example:
1. Draw a flowchart that computes and prints the sum of two input numbers.
Solution: In Algorithm
Enter n1, n2
Sum=n1+n2
Print Sum
End
2. Write an algorithm and pseudocode the draw a flowchart to convert the length in
feet to centimeters.
Solution: In Pseudocode
Solution: In Algorithm
Solution: In Flowchart
Begin
Input Lft
Lcm = Lft x 30
Print Lcm
End
PRECEDENCE OF OPERATORS
Rule: In expressions where two operators can be applied to an operand, the table of
precedence is used to determine which operator should be applied FIRST.
Computer has the capability to make choices and decides logical decision based on
some conditions. Sometimes, this topic of flowcharting and programming is referred as
selection control structure, because it involves selection of two or more choices and
decide based on a given condition. In this conditional statement, there is a conditional
test to be performed by the computer to determine what course of action to be taken.
The conditional test produces either a true (yes) or false (no) value.
Example:
1. Draw a flowchart that determines if the input age is qualified to vote or not.
Qualifying age is 18. If qualified, print “Qualified to vote”, if not (else), print “Too
Young!”.
Solution: In Algorithm
Begin
Enter Age
If T
Qualified to vote
Age>+18
Too Young!
End