WRITING AN ALGORITHM,
PSEUDOCODE, AND
FLOWCHART
SOLVING PROGRAMMING PROBLEMS
Programming
• A process of problem
solving.
Source Code
• Human instructions for the
computer
PROCESS IN SOLVING PROGRAMMING
LANGUAGE
Problem • Identify the problem
Analysis
• Analyze the problem to identify
possible solutions.
Algorithm • To itemize the possible step-by-step
instructions
• Process of source codes entered through
Coding a programming language
• The instructions will be translated with the help of Library.
Compiler • Library – collection of resources or routines used by computer
programs
• (No syntax error) It will
Linker process the code for execution
• It will lead the codes for the
Execution desired output.
Output •Result
WHAT IS A FLOWCHART?
•A diagram representing the logical
sequence with combination of steps
or operations to performed.
BASIC SYMBOL USED IN
FLOWCHARTING
BASIC SYMBOL USED IN FLOWCHARTING
• TERMINATOR
Beginning and the end of
the flowchart (“Start” and
“End”)
BASIC SYMBOL USED IN FLOWCHARTING
• INPUT/OUTPUT
Used if the flowchart needs
input from the user or output
from the process
BASIC SYMBOL USED IN FLOWCHARTING
• PROCESS
Used to process data
Normally composed of
mathematical symbols
BASIC SYMBOL USED IN FLOWCHARTING
• ARROWS
Shows the flow of the
Process
DRAWING A FLOWCHART
START
Input Lft
Lcm = Lft * 30.48
Print Lft
WHAT IS A PSEUDOCODE?
• Description of an algorithm using a natural
language that makes reading program
easier.
• Uses short English statements to write
codes for programs.
WHAT IS AN ALGORITHM?
• STEP-BY-STEP procedure to solve
problems.
• It helps to identify processes and special
variables to solve the problem.
WRITING A PSEUDOCODE
•Input the length in feet (Lft)
•Calculate the length in (Lcm) by
multiplying Lft with 30.48
•Print Length in cm (Lcm)
WRITING AN ALGORITHM
Step 1: Input Lft
Step 2: Lcm = Lft x 30.48
Step 3: Print Lcm
DRAWING A FLOWCHART
START
Input Lft
Lcm = Lft * 30.48
Print Lft
END
WRITING THE PSEUDOCODE
•Input the three numbers (a), (b),
and (c).
•Compute for the Average (A) by
adding number (a), (b) and (c) and
divide the sum to three.
WRITING THE PSEUDOCODE
•Display Average (A)
WRITING AN ALGORITHM
•Step 1: Input a, b, c
•Step 2: A = a+b+c/3
•Step 3: Display A
DRAWING A FLOWCHART
START
Input a, b, c
A = a+b+c/3
Display A
END
WRITING THE PSEUDOCODE
•Input the base (b)
•Input the percentage (p)
•Convert the percentage (p) to decimal
(d) by dividing (p) by 100
•Multiply base (b) by decimal (d)
WRITING AN ALGORITHM
•Step 1:
•Step 2:
•Step 3:
•Step 4:
WRITING THE PSEUDOCODE
•Input the number of girls (g)
•Input the number of boys (b)
•Input a colon (:) between the number of
boys and girls.
•Display the ratio of the class (C)
WRITING AN ALGORITHM
•Step 1:
•Step 2:
•Step 3:
•Step 4: