Вы находитесь на странице: 1из 23

Discuss the following:

1. Data
2. Process
3. Information
4. Algorithm
5. Pseudocode
6. Flowchart
ALGORITHMS, PSEUDOCODES
AND FLOWCHARTS

Prepared by:
Eleanor B. De la Vega
Subject Teacher
OBJECTIVES
• Understand what is algorithm
• Use pseudocode and
flowchart in problem solving
• Understand the relationship of
flowcharts and pseudocodes
in planning
ALGORITHM
• Is a step by step procedure to solve problems.
• It is a list of instructions specifying a precise
description of a step by step process that
terminates after a finite number of steps for
solving an algorithm problem producing the
correct answer in the end.
EXAMPLES OF ALGORITHM
Usual process of changing a flat • A recipe in a cook
tire: book
1. Jack up the car • A dance choreography
2. Unscrew the lugs • Manuals
3. Remove the wheel
4. Any spare tires?
5. If none, go to vulcanizing shop,
if there is put on the spare
6. Screw on the lugs
7. Jack the car down
EXAMPLES OF ALGORITHM
Detailed Algorithm:
Step 1: Input M1, M2, M3, M4
Step 2: GRADE ← (M1+M2+M3+M4)/4
Step 3: If (GRADE < 50) then
Print “FAIL”
else
“PASS”
endif
Properties of Algorithm
• Finiteness – there is an exact number
of steps to be taken and has an end.
• Absence of Ambiguity – means that
every instruction is precisely
described and clearly specified.
• Sequence of Execution – instructions
are performed from top to bottom.
Properties of Algorithm (continuation)
• Input and Output – defined the
unknowns of the problem is specified
and with the expected outcome.
• Effectiveness – the solution
prescribed is guaranteed to give a
correct answer and that the specified
process is faithfully carried out.
• Scope Definition – applies to a
specific problem or class of problem.
METHODS OF SPECIFYING
ALGORITHM
• PSEUDOCODE
• FLOWCHART
PSEUDOCODE
• Specifies the steps of algorithm using
essentially natural language of
superimposed control structure.
• A description of an algorithm or a
computer program using natural
language.
SAMPLE PSEUDOCODE
• Input a set of 4 marks
• Calculate the average by summing and dividing
by 4
• If average is below 50
Print “FAIL”
else
Print “PASS”
FLOWCHART
• is a diagram representing the logical
sequence in which a combination of steps
or operations is to be performed.
• It also serves as the blueprint during the
Program Development Process.
Advantage of Flowchart Limitations of Flowchart
• Learned and applied • Do not represent a
without a formal programming language.
knowledge of • It does not convey why a
programming language. given set of operations is
• Provide an alternative to made, flowchart only
the usual narrative portray how.
description. • Do not highlight
• Easier to understand. important details.
FLOWCHART STANDARD SYMBOLS
SYMBOL NAME DESCRIPTION
Signifies the beginning or the end of a
Terminator
program
Perform processing functions of the
Process program such as arithmetic operations,
compare, sort, etc.
Indicates when a decision needs to be
Decision made like yes/no or a true/false
questions.
Input/Output Signifies data input or output
Operation
FLOWCHART STANDARD SYMBOLS
SYMBOL NAME DESCRIPTION
Indicates the logic flow’s direction. The
Arrow (Flow default is from left to right and top to
lines)
bottom.
On-page Non-processing symbol use to connect
Connector a flowchart that exceed a single page
Designate entry to or exit from a page
Off-page
Connector
when a flowchart requires more than
one page.
Sample Flowchart
Input
M1,M2,M3,M4

GRADE = (M1+M2+M3+M4)/4

YES Is GRADE
NO
< 50

PRINT PRINT
“FAIL” “PASS”

END
What is the relationship
of Flowchart and
Pseudocode in Planning?
• Identifying System Specification and Requirements
- purposes system and user interfaces, database
requirements, quality standards, operations, overview of the
whole application, and other requirements needed for the
project development is defined.
• Creating the Applicable Diagram Based on the Acquired
Requirement
- it is all about creating flowcharts and pseudocodes
based on the requirements acquired from the previous
substage, specifically from the identifying the system and user
interface as well as the database requirements.
Obtaining Design Documentation
• Design Documentation
- is the written description of the
overall design or architecture of the system
to be made.
• Responsibility-driven Design
- describes the roles of each
object in the user interface and the
information they share.
• Architectural Design
- establishes the input and
output flow of the program.
• User-Interface Design
- focuses on user’s interaction
towards GUI.
• Procedural Design
- lets the programmers use the
proposed system’s flowchart or
pseudocode and translate them into
code.

Вам также может понравиться