0% found this document useful (0 votes)
28 views31 pages

Topic 2 - Algorithm and Flowchart

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
28 views31 pages

Topic 2 - Algorithm and Flowchart

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 31

ALGORITHMS AND FLOWCHARTS

BERNADETH B. LIGGAYU, MIT


ALGORITHM

The word Algorithm means ”


A set of rules to be followed
in calculations or other
problem-solving operations ”
Or ” A procedure for solving
a mathematical problem in a
finite number of steps that
frequently involves recursive
operations”.
FLOWCHARTS
 A flowchart is a diagram representing the logical sequence
in which a combination of steps or operation is to be
performed.
 It consists of labeled geometrical figures or symbols that
are interconnected to provide a pictorial representation of
a data processing procedure.
 Their major uses are in documentation and in
programming. As a documentation tool, a flowchart aid in
communicating the nature of the operation, regardless of
the programming language or the computer used.
ADVANTAGES OF FLOWCHART

➢ Since flowcharts are language – independent, they can be


learned and applied without formal knowledge of a programming
language.
➢ It enforces users to give attention to significant matters over the
less significant ones.
➢ Being graphically portrayed, flowcharts provide an alternative to the
usual narrative description of a system or a program.
➢ Flowcharts are easier to understand than a program written in a
particular programming language.
LIMITATIONS OF FLOWCHARTS
➢ Flowcharts do not represent a programming language and are more of a person to person than person to
computer means of communication. A computer cannot accept a program described in flowcharting form.

➢ Since thinking in graphic terms is not normal, flowcharts cannot be viewed as natural means of
communication.

➢ Certain details often require a long sequence of interconnected symbols which could easily be described in
just few lines of explanation.

➢ It does not convey why a given set of operations is made. Flowcharts only portray how.

➢ Flowcharts do not highlight the important details since each step receives as much attention in a flowchart as
any other.
TYPES OF FLOWCHARTS

1. Program Flowchart

 A program flowchart describes graphically in detail the


logical operations and steps within a program and the
sequence in which these steps are to be executed for the
transformation of data to produce the needed output.
System Flowchart

A system flowchart is a graphic representation of the procedures involved in converting


data on input media to data in output form. It illustrates which data is used or
produced at various points in a sequence of operations.
BASIC SYMBOLS IN FLOWCHARTING
DRAW A FLOWCHART THAT WILL DISPLAY THE SUM OF TWO
ENTERED INTEGERS

➢Ask the user to enter 2 integers


➢Process it with sum
➢Display result
DRAW A FLOWCHART THAT WILL DISPLAY THE SUM OF TWO
ENTERED INTEGERS

Requirement of the Problem Number 1


1. Ask the user to enter 4 integers
2. Process it with sum
3. Display result
DRAW A FLOWCHART THAT WILL COMPUTE FOR THE AVERAGE OF
THREE INPUT QUIZZES. THEN DISPLAY THE RESULT.

Requirement of the Problem Number


➢Ask the user to input three quiz scores
➢Get the average of the three quizzes. Average is getting the sum
of three scores divided by three. Therefore the formula is
(score1 + score2 + score3) / 3
➢Display result
ANSWER
DECISION SYMBOL

 Use of Decision Symbol One of the symbols used in flowcharting


is the decision symbol or the diamond. This symbol requires
logical test that could be determined by using conditional
statements or characters which are listed below. Through logical
test, this symbol provides two answer, if the value evaluated by
the decision symbol produces a “true” result or if it did not meet
the value on the conditional statement it renders a “false” value.
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
EQUAL

 The operator is used to compare two values for similarity.


 Syntax of the operator is: Is Value1 = Value2
 If the value1 and value2 have the same value, then they will move to
the true side of the decision symbol. If both values hold different
values, on the decision symbol it will move to the false side.
PROBLEM

Draw a flowchart that will display “Access Granted” if the


password entered is equal to “Computer” else will display
Access denied
1. Ask the user to enter password
2. Display “Access Granted” if the password entered is equal to
“Computer”, on the false side display “Access Denied”
 Note: If the problem is with display, you can use Output
Symbol. (In Decision making) If the problem is with
Process use process symbol

You might also like