SlideShare a Scribd company logo
ALGORITHM AND
FLOWCHARTING
Lesson 2 – Data Structures and Algorithm
MR. ROWELL L. MARQUINA
IT Instructor, PUP Biñan
WHAT IS AN
ALGORITHM?
What is an Algorithm?
An algorithm refers to a series of well-defined
instructions on how to accomplish a task or
solve a specific problem.
IMAGE SOURCE: https://imgbin.com/png/uxvDNRys/computer-programming-computer-icons-technology-algorithm-png
https://www.flaticon.com/free-icon/coding_1085774
▪ Giving directions on how to get to
somebody’s house is an algorithm.
▪ The steps on how to change a light bulb is
an algorithm.
▪ The steps to compute the for average is
also an algorithm.
STEPS IN DEVELOPING AN ALGORITHM:
1. In creating an algorithm, it is very important to determine the
exact goal or expected product first. The goal or expected
product of the algorithm is called OUTPUT.
2. After determining the output, the next step is to identify the
necessary materials or elements needed to accomplish the
task. The elements needed for the program is called INPUT.
3. If the input and output are already identified, it is time to list
the steps needed to accomplish the task. The steps needed
to accomplish the task is referred to as the PROCESS.
CHARACTERISTICS OF AN ALGORITHM:
An algorithm should possess the following characteristics:
▪ It should have well-defined input and output.
▪ The steps should be stated clearly and unambiguously.
▪ It should have an exact start and end.
▪ It should be simple but precise.
▪ It should be practical.
WHAT IS
FLOWCHART?
What is a Flowchart?
A flowchart is a diagram that
illustrates a process, system or
computer algorithm.
IMAGE SOURCE: https://www.frevvo.com/blog/wp-content/uploads/2021/10/image5-2.png
Flowcharts are widely used in
multiple fields for the purpose of:
▪ documentation
▪ planning
▪ analysis
▪ presentation
Flowchart Symbols
The American National Standards
Institute (ANSI) set standards for
flowcharts and their symbols in the
1960s.
IMAGE SOURCES:
https://upload.wikimedia.org/wikipedia/commons/thumb/9/93/ANSI_logo.svg/1200px-ANSI_logo.svg.png
https://1000logos.net/wp-content/uploads/2020/09/ISO-Logo.png
In 1970 the International Organization
for Standardization (ISO) adopted the
ANSI symbols as the international
standard for developing flowcharts.
Flowchart Symbols
IMAGE SOURCES:
https://uploads-ssl.webflow.com/6184b461a39ff13bfb8c0556/61de99e8171cc6468145551d_flowchart-symbols-800.png
Flowchart Symbols
NAME OF SYMBOL SYMBOL FUNCTION
Terminal Symbol
Indicates the beginning and end of the
flowchart.
Flowline Symbol
Its shows the process’ direction or the
next steps in the process.
Process Symbol
It shows the process or operations to be
carried out by the program
Decision Symbol
It shows the step that contains a control
mechanism or decision.
Input/Output Symbol
It indicates the process of getting data
from the user or displaying data on
screen.
SAMPLE FLOWCHART 1:
DETERMINING USER’S AGE
Create a flowchart for a program that will
require the user to input their year of birth. Using
the user’s year of birth, the program will
compute for the user’s age and display its result
on the computer screen.
START
birthyear, age
display
“Enter Year of Birth:”
input
birthyear
age = 2023 - birthyear
display
age
END
The program is initiated.
The variables birthyear and age were introduced to the
program.
The program displays the instruction “Enter Year of Birth: ”
on the screen.
The program get an input from the user and store its value in
the variable birthyear.
The program computes for the value of age using the
formula age = 2023 - birthyear.
The program displays the value of age on the screen.
The program is terminated.
SAMPLE FLOWCHART 2:
CONVERTING FROM KILOGRAM TO POUND
Create a flowchart for a program that will require
the user to input a value in kilogram (kg). The
program will convert the inputted value into
pounds (lbs.) and display its results on the screen.
START
kilo, pound
display
“Enter Weight in
Kilogram:”
input
kilo
pound = kilo * 2.2
display
pound
END
The program is initiated.
The variables kilo and pound were introduced to the
program.
The program displays the instruction “Enter Weight in
Kilogram: ” on the screen.
The program get an input from the user and store its value in
the variable kilogram.
The program computes for the value of pound using the
formula pound = kilo * 2.2.
The program displays the value of pound on the screen.
The program is terminated.
SAMPLE FLOWCHART 3:
COMPUTING FOR AREA:
Create a flowchart for a program that will require
the user to input the length and width of a
rectangle. The program will compute for the area
of the rectangle using the inputted length and
with and display its results on the screen.
START
length, width, area
display
“Enter Length:”
input
length
The program is initiated.
The variables length, width, and area were introduced to
the program.
The program displays the instruction “Enter Length: ” on
the screen.
The program get an input from the user and store its value in
the variable length.
The program displays the instruction “Enter Width: ” on
the screen.
The program get an input from the user and store its value
in the variable width.
The program will be continued on the next slide.
display
“Enter Width:”
input
width
A
area = length * width
display
area
The program is continued.
The program computes for the value of area using the
formula area = length*width.
The program displays the value of area on the screen.
The program is terminated.
A
END
SAMPLE FLOWCHART 4:
PLAYING WITH NUMBERS
Create a flowchart for a program that will require
the user to input four numbers. Using the inputs,
the program will compute for:
▪ the sum of 1st and 2nd number,
▪ the product of the 3rd and 4th number
▪ the square of the 2nd number
START
num1, num2, num3, num4,
sum, product, square
display
“Enter the First
Number: ”
input
num1
The program is initiated.
The variables num1, num2, num3, num4, sum,
product, and square were introduced to the program.
The program displays the instruction “Enter the First
Number: ” on the screen.
The program get an input from the user and store its value in
the variable num1.
The program displays the instruction “Enter the Second
Number: ” on the screen.
The program get an input from the user and store its value
in the variable num2.
The program will be continued on the next slide.
display
“Enter the Second
Number: ”
input
num2
A
display
“Enter the Third
Number: ”
input
num3
The program is continued.
The program displays the instruction
“Enter the Third Number: ” on the screen.
The program get an input from the user and store its value in
the variable num3.
The program displays the instruction
“Enter the Fourth Number: ” on the screen.
The program get an input from the user and store its value
in the variable num4.
The program will be continued on the next slide.
display
“Enter the Fourth
Number: ”
input
num4
B
A
sum = num1 + num2
The program computes for the value of sum using the
formula sum = a + b.
display
sum
The program is continued.
The program is terminated.
display
square
B
product = num3 * num4
The program computes for the value of product using
the formula product = num3*num4.
square = num2 * num2
display
product
END
The program computes for the value of square using
the formula square = num2 * num2.
The program displays the value of sum on the screen.
The program displays the value of product on the screen.
The program displays the value of square on the screen.
SAMPLE FLOWCHART 5:
PLAYING WITH NUMBERS
Create a flowchart for a program that will require
the user to input four numbers. Using the inputs,
the program will compute for:
▪ the cube of the 1st number,
▪ the half of the 2nd number,
▪ the 20% of the 3rd number,
▪ The product of multiplying the 4th
number by 100
START
num1, num2, num3, num4,
cube, half, twentyp, times100
display
“Enter the First
Number: ”
input
num1
The program is initiated.
The variables num1, num2, num3, num4, cube, half,
twentyp, and times100 were introduced to the
program.
The program displays the instruction “Enter the First
Number: ” on the screen.
The program get an input from the user and store its value in
the variable num1.
The program displays the instruction “Enter the Second
Number: ” on the screen.
The program get an input from the user and store its value
in the variable num2.
The program will be continued on the next slide.
display
“Enter the Second
Number: ”
input
num2
A
display
“Enter the Third
Number: ”
input
num3
The program is continued.
The program displays the instruction
“Enter the Third Number: ” on the screen.
The program get an input from the user and store its value in
the variable num3.
The program displays the instruction
“Enter the Fourth Number: ” on the screen.
The program get an input from the user and store its value
in the variable num4.
The program will be continued on the next slide.
display
“Enter the Fourth
Number: ”
input
num4
B
A
cube = num1 * num1 * num1
The program computes for the value of cube using the
formula cube = num1 * num1 * num1.
The program is continued.
The program is terminated.
B
half = num2 / 2
The program computes for the value of half using the
formula half = num2 / 2.
twentyp = num3 * 0.20
END
The program computes for the value of twentyp using
the formula twentyp = num3 * 0.20.
The program displays the value of cube on the screen.
The program displays the value of half on the screen.
The program displays the value of twentyp on the screen.
times100 = num4 * 100
display
cube
display
half
display
twentyp
display
times100
The program computes for the value of times100
using the formula times100 = num4 * 100.
The program displays the value of times100 on the screen.
PRACTICE TEST 1:
DOLLAR TO PESO CONVERSION
Create a flowchart for a program that will require
the user to input the amount in US Dollars. Using
the inputted amount, the program will convert it
to its Philippine Peso value and display the answer
on the screen.
Note: 1 US Dollar = Php 56.78
PRACTICE TEST 2:
COMPUTING FOR AVERAGE
Create a flowchart for a program that will require
the user to input their grades in Mathematics,
English, and Science. The program will compute
for the average of the three grades and display
its result on the computer screen.
PRACTICE TEST 3:
PLAYING WITH NUMBERS
Create a flowchart for a program that will require
the user to input four numbers. Using the inputs,
the program will perform the following:
▪ display the 1st number,
▪ get the product of 1st and 3rd number,
▪ get the product of multiplying the 2nd number
by the sum of the 3rd and 4th number,
▪ the average of the four numbers increased by 5.
ALGORITHM AND
FLOWCHARTING
MR. ROWELL L. MARQUINA
Professional Lecturer,
Polytechnic University of the Philippines
Email Address:
rowell.marquina001@deped.gov.ph
sirrowellmarquina@gmail.com
rmarquina@mitis.edu.ph

More Related Content

What's hot (20)

PPTX
COCOMO (Software Engineering)
Biswadeep Mukhopadhyay
 
PPTX
introduction to programming languages
NaqashAhmad14
 
PPTX
Phased life cycle model
Stephennancy
 
PPTX
Strategy of software design
Self-employed
 
PDF
Visual Basic 6.0
Anjan Mahanta
 
PDF
Rayleigh model
Roy Antony Arnold G
 
PPT
UML Case Tools
Ashesh R
 
PDF
Linker and Loader Explained
Adarsh Kr Sinha
 
PDF
Introduction to computer programming
Noel Malle
 
PPTX
Composite transformation
Pooja Dixit
 
PPTX
Programming Fundamentals lecture 1
REHAN IJAZ
 
PPTX
Presentation on C programming language
Ashmita Tuition Center
 
PPT
32 dynamic linking nd overlays
myrajendra
 
PDF
Features of c
Hitesh Kumar
 
PPT
Computer programming concepts
Jasper John Cinatad
 
PPTX
Programming Fundamental Slide No.1
Arslan Hussain
 
PPTX
1. importance of c
Alamgir Hossain
 
PPTX
Raster scan system & random scan system
shalinikarunakaran1
 
COCOMO (Software Engineering)
Biswadeep Mukhopadhyay
 
introduction to programming languages
NaqashAhmad14
 
Phased life cycle model
Stephennancy
 
Strategy of software design
Self-employed
 
Visual Basic 6.0
Anjan Mahanta
 
Rayleigh model
Roy Antony Arnold G
 
UML Case Tools
Ashesh R
 
Linker and Loader Explained
Adarsh Kr Sinha
 
Introduction to computer programming
Noel Malle
 
Composite transformation
Pooja Dixit
 
Programming Fundamentals lecture 1
REHAN IJAZ
 
Presentation on C programming language
Ashmita Tuition Center
 
32 dynamic linking nd overlays
myrajendra
 
Features of c
Hitesh Kumar
 
Computer programming concepts
Jasper John Cinatad
 
Programming Fundamental Slide No.1
Arslan Hussain
 
1. importance of c
Alamgir Hossain
 
Raster scan system & random scan system
shalinikarunakaran1
 

Similar to DSA Lesson 2 - Algorithm and Flowcharting.pdf (20)

PDF
Lesson 1 - Algorithm and Flowcharting.pdf
ROWELL MARQUINA
 
PDF
Programming Fundamental handouts
International Islamic University
 
DOCX
COMP 122 Entire Course NEW
shyamuopeight
 
PDF
Lesson 5 - Getting Input from Users.pdf
ROWELL MARQUINA
 
DOCX
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
AASTHA76
 
PDF
C Programming Lab manual 18CPL17
manjurkts
 
DOCX
California State University, Fullerton College of Engineerin.docx
humphrieskalyn
 
PDF
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
manjurkts
 
DOCX
EC6612 VLSI Design Lab Manual
tamil arasan
 
DOCX
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
clarebernice
 
PDF
Computer Science chapter 7 functions class 12
HarishSinghGhughtyal
 
DOCX
Practical File of c++.docx lab manual program question
vidhimangal05
 
PPT
Chapter 2- Prog101.ppt
JosephObadiahTuray
 
DOCX
Project 2Project 2.pdfIntroduction to Programming EECS 1.docx
wkyra78
 
DOCX
c++ Question
Hamza4467
 
PDF
Year 2 dsa c++ exercises on user defined functions
ErnesteNtezirizaza
 
PPT
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
cskvsmi44
 
PPT
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
noahjamessss
 
DOC
CIS 170 Imagine Your Future/newtonhelp.com   
bellflower42
 
DOC
CIS 170 Life of the Mind/newtonhelp.com   
llflowe
 
Lesson 1 - Algorithm and Flowcharting.pdf
ROWELL MARQUINA
 
Programming Fundamental handouts
International Islamic University
 
COMP 122 Entire Course NEW
shyamuopeight
 
Lesson 5 - Getting Input from Users.pdf
ROWELL MARQUINA
 
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
AASTHA76
 
C Programming Lab manual 18CPL17
manjurkts
 
California State University, Fullerton College of Engineerin.docx
humphrieskalyn
 
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
manjurkts
 
EC6612 VLSI Design Lab Manual
tamil arasan
 
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
clarebernice
 
Computer Science chapter 7 functions class 12
HarishSinghGhughtyal
 
Practical File of c++.docx lab manual program question
vidhimangal05
 
Chapter 2- Prog101.ppt
JosephObadiahTuray
 
Project 2Project 2.pdfIntroduction to Programming EECS 1.docx
wkyra78
 
c++ Question
Hamza4467
 
Year 2 dsa c++ exercises on user defined functions
ErnesteNtezirizaza
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
cskvsmi44
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
noahjamessss
 
CIS 170 Imagine Your Future/newtonhelp.com   
bellflower42
 
CIS 170 Life of the Mind/newtonhelp.com   
llflowe
 
Ad

More from ROWELL MARQUINA (20)

PDF
WSAT Lesson 3 - Introduction to HTML.pdf
ROWELL MARQUINA
 
PDF
PLD Lesson 5 - Displaying Text and Comment on the Screen.pdf
ROWELL MARQUINA
 
PDF
COM Lesson 1 - Introduction to Computer Organization and Management.pdf
ROWELL MARQUINA
 
PDF
PROG3 Lesson 4 - Setting Up the VS Code Environment.pdf
ROWELL MARQUINA
 
PDF
PLD Lesson 4 - Setting Up the VS Code Environment.pdf
ROWELL MARQUINA
 
PDF
PLD Lesson 3 - Flowcharting Conditional Statements.pdf
ROWELL MARQUINA
 
PDF
FoR Lesson 1 - Introduction to Research.pdf
ROWELL MARQUINA
 
PDF
Lesson 3 - Understanding Professional Ethics.pdf
ROWELL MARQUINA
 
PDF
WSAT Lesson 2 - Introduction to World Wide Web.pdf
ROWELL MARQUINA
 
PDF
WSAT Lesson 1 - Introduction to Web Systems and Technologies.pdf
ROWELL MARQUINA
 
PDF
ITSP Lesson 2 - Ethical Principles and Theories.pdf
ROWELL MARQUINA
 
PDF
ITSP Lesson 1 - Ethics and Its History.pdf
ROWELL MARQUINA
 
PDF
WSAT Lesson 1 - Introduction to Web Systems and Technologies.pdf
ROWELL MARQUINA
 
PDF
Lesson 2 - Algorithm and Flowcharting.pdf
ROWELL MARQUINA
 
PDF
Introduction to Programming and Languages.pdf
ROWELL MARQUINA
 
PDF
QMMS Lesson 2 - Using MS Excel Formula.pdf
ROWELL MARQUINA
 
PPTX
QMMS Lesson 2 - Using Excel Formula.pptx
ROWELL MARQUINA
 
PDF
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
ROWELL MARQUINA
 
PDF
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
ROWELL MARQUINA
 
PDF
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
ROWELL MARQUINA
 
WSAT Lesson 3 - Introduction to HTML.pdf
ROWELL MARQUINA
 
PLD Lesson 5 - Displaying Text and Comment on the Screen.pdf
ROWELL MARQUINA
 
COM Lesson 1 - Introduction to Computer Organization and Management.pdf
ROWELL MARQUINA
 
PROG3 Lesson 4 - Setting Up the VS Code Environment.pdf
ROWELL MARQUINA
 
PLD Lesson 4 - Setting Up the VS Code Environment.pdf
ROWELL MARQUINA
 
PLD Lesson 3 - Flowcharting Conditional Statements.pdf
ROWELL MARQUINA
 
FoR Lesson 1 - Introduction to Research.pdf
ROWELL MARQUINA
 
Lesson 3 - Understanding Professional Ethics.pdf
ROWELL MARQUINA
 
WSAT Lesson 2 - Introduction to World Wide Web.pdf
ROWELL MARQUINA
 
WSAT Lesson 1 - Introduction to Web Systems and Technologies.pdf
ROWELL MARQUINA
 
ITSP Lesson 2 - Ethical Principles and Theories.pdf
ROWELL MARQUINA
 
ITSP Lesson 1 - Ethics and Its History.pdf
ROWELL MARQUINA
 
WSAT Lesson 1 - Introduction to Web Systems and Technologies.pdf
ROWELL MARQUINA
 
Lesson 2 - Algorithm and Flowcharting.pdf
ROWELL MARQUINA
 
Introduction to Programming and Languages.pdf
ROWELL MARQUINA
 
QMMS Lesson 2 - Using MS Excel Formula.pdf
ROWELL MARQUINA
 
QMMS Lesson 2 - Using Excel Formula.pptx
ROWELL MARQUINA
 
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
ROWELL MARQUINA
 
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
ROWELL MARQUINA
 
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
ROWELL MARQUINA
 
Ad

Recently uploaded (20)

PPTX
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
PPTX
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
PDF
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
PDF
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
PDF
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
PDF
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
PPTX
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
PDF
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Building a Production-Ready Barts Health Secure Data Environment Tooling, Acc...
Barts Health
 
Building and Operating a Private Cloud with CloudStack and LINBIT CloudStack ...
ShapeBlue
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Human-centred design in online workplace learning and relationship to engagem...
Tracy Tang
 
NewMind AI Journal - Weekly Chronicles - July'25 Week II
NewMind AI
 
Why Orbit Edge Tech is a Top Next JS Development Company in 2025
mahendraalaska08
 
Smart Air Quality Monitoring with Serrax AQM190 LITE
SERRAX TECHNOLOGIES LLP
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Building Resilience with Digital Twins : Lessons from Korea
SANGHEE SHIN
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
CloudStack GPU Integration - Rohit Yadav
ShapeBlue
 
Persuasive AI: risks and opportunities in the age of digital debate
Speck&Tech
 
Extensions Framework (XaaS) - Enabling Orchestrate Anything
ShapeBlue
 
Wojciech Ciemski for Top Cyber News MAGAZINE. June 2025
Dr. Ludmila Morozova-Buss
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 

DSA Lesson 2 - Algorithm and Flowcharting.pdf

  • 1. ALGORITHM AND FLOWCHARTING Lesson 2 – Data Structures and Algorithm MR. ROWELL L. MARQUINA IT Instructor, PUP Biñan
  • 3. What is an Algorithm? An algorithm refers to a series of well-defined instructions on how to accomplish a task or solve a specific problem. IMAGE SOURCE: https://imgbin.com/png/uxvDNRys/computer-programming-computer-icons-technology-algorithm-png https://www.flaticon.com/free-icon/coding_1085774 ▪ Giving directions on how to get to somebody’s house is an algorithm. ▪ The steps on how to change a light bulb is an algorithm. ▪ The steps to compute the for average is also an algorithm.
  • 4. STEPS IN DEVELOPING AN ALGORITHM: 1. In creating an algorithm, it is very important to determine the exact goal or expected product first. The goal or expected product of the algorithm is called OUTPUT. 2. After determining the output, the next step is to identify the necessary materials or elements needed to accomplish the task. The elements needed for the program is called INPUT. 3. If the input and output are already identified, it is time to list the steps needed to accomplish the task. The steps needed to accomplish the task is referred to as the PROCESS.
  • 5. CHARACTERISTICS OF AN ALGORITHM: An algorithm should possess the following characteristics: ▪ It should have well-defined input and output. ▪ The steps should be stated clearly and unambiguously. ▪ It should have an exact start and end. ▪ It should be simple but precise. ▪ It should be practical.
  • 7. What is a Flowchart? A flowchart is a diagram that illustrates a process, system or computer algorithm. IMAGE SOURCE: https://www.frevvo.com/blog/wp-content/uploads/2021/10/image5-2.png Flowcharts are widely used in multiple fields for the purpose of: ▪ documentation ▪ planning ▪ analysis ▪ presentation
  • 8. Flowchart Symbols The American National Standards Institute (ANSI) set standards for flowcharts and their symbols in the 1960s. IMAGE SOURCES: https://upload.wikimedia.org/wikipedia/commons/thumb/9/93/ANSI_logo.svg/1200px-ANSI_logo.svg.png https://1000logos.net/wp-content/uploads/2020/09/ISO-Logo.png In 1970 the International Organization for Standardization (ISO) adopted the ANSI symbols as the international standard for developing flowcharts.
  • 10. Flowchart Symbols NAME OF SYMBOL SYMBOL FUNCTION Terminal Symbol Indicates the beginning and end of the flowchart. Flowline Symbol Its shows the process’ direction or the next steps in the process. Process Symbol It shows the process or operations to be carried out by the program Decision Symbol It shows the step that contains a control mechanism or decision. Input/Output Symbol It indicates the process of getting data from the user or displaying data on screen.
  • 11. SAMPLE FLOWCHART 1: DETERMINING USER’S AGE Create a flowchart for a program that will require the user to input their year of birth. Using the user’s year of birth, the program will compute for the user’s age and display its result on the computer screen.
  • 12. START birthyear, age display “Enter Year of Birth:” input birthyear age = 2023 - birthyear display age END The program is initiated. The variables birthyear and age were introduced to the program. The program displays the instruction “Enter Year of Birth: ” on the screen. The program get an input from the user and store its value in the variable birthyear. The program computes for the value of age using the formula age = 2023 - birthyear. The program displays the value of age on the screen. The program is terminated.
  • 13. SAMPLE FLOWCHART 2: CONVERTING FROM KILOGRAM TO POUND Create a flowchart for a program that will require the user to input a value in kilogram (kg). The program will convert the inputted value into pounds (lbs.) and display its results on the screen.
  • 14. START kilo, pound display “Enter Weight in Kilogram:” input kilo pound = kilo * 2.2 display pound END The program is initiated. The variables kilo and pound were introduced to the program. The program displays the instruction “Enter Weight in Kilogram: ” on the screen. The program get an input from the user and store its value in the variable kilogram. The program computes for the value of pound using the formula pound = kilo * 2.2. The program displays the value of pound on the screen. The program is terminated.
  • 15. SAMPLE FLOWCHART 3: COMPUTING FOR AREA: Create a flowchart for a program that will require the user to input the length and width of a rectangle. The program will compute for the area of the rectangle using the inputted length and with and display its results on the screen.
  • 16. START length, width, area display “Enter Length:” input length The program is initiated. The variables length, width, and area were introduced to the program. The program displays the instruction “Enter Length: ” on the screen. The program get an input from the user and store its value in the variable length. The program displays the instruction “Enter Width: ” on the screen. The program get an input from the user and store its value in the variable width. The program will be continued on the next slide. display “Enter Width:” input width A
  • 17. area = length * width display area The program is continued. The program computes for the value of area using the formula area = length*width. The program displays the value of area on the screen. The program is terminated. A END
  • 18. SAMPLE FLOWCHART 4: PLAYING WITH NUMBERS Create a flowchart for a program that will require the user to input four numbers. Using the inputs, the program will compute for: ▪ the sum of 1st and 2nd number, ▪ the product of the 3rd and 4th number ▪ the square of the 2nd number
  • 19. START num1, num2, num3, num4, sum, product, square display “Enter the First Number: ” input num1 The program is initiated. The variables num1, num2, num3, num4, sum, product, and square were introduced to the program. The program displays the instruction “Enter the First Number: ” on the screen. The program get an input from the user and store its value in the variable num1. The program displays the instruction “Enter the Second Number: ” on the screen. The program get an input from the user and store its value in the variable num2. The program will be continued on the next slide. display “Enter the Second Number: ” input num2 A
  • 20. display “Enter the Third Number: ” input num3 The program is continued. The program displays the instruction “Enter the Third Number: ” on the screen. The program get an input from the user and store its value in the variable num3. The program displays the instruction “Enter the Fourth Number: ” on the screen. The program get an input from the user and store its value in the variable num4. The program will be continued on the next slide. display “Enter the Fourth Number: ” input num4 B A sum = num1 + num2 The program computes for the value of sum using the formula sum = a + b.
  • 21. display sum The program is continued. The program is terminated. display square B product = num3 * num4 The program computes for the value of product using the formula product = num3*num4. square = num2 * num2 display product END The program computes for the value of square using the formula square = num2 * num2. The program displays the value of sum on the screen. The program displays the value of product on the screen. The program displays the value of square on the screen.
  • 22. SAMPLE FLOWCHART 5: PLAYING WITH NUMBERS Create a flowchart for a program that will require the user to input four numbers. Using the inputs, the program will compute for: ▪ the cube of the 1st number, ▪ the half of the 2nd number, ▪ the 20% of the 3rd number, ▪ The product of multiplying the 4th number by 100
  • 23. START num1, num2, num3, num4, cube, half, twentyp, times100 display “Enter the First Number: ” input num1 The program is initiated. The variables num1, num2, num3, num4, cube, half, twentyp, and times100 were introduced to the program. The program displays the instruction “Enter the First Number: ” on the screen. The program get an input from the user and store its value in the variable num1. The program displays the instruction “Enter the Second Number: ” on the screen. The program get an input from the user and store its value in the variable num2. The program will be continued on the next slide. display “Enter the Second Number: ” input num2 A
  • 24. display “Enter the Third Number: ” input num3 The program is continued. The program displays the instruction “Enter the Third Number: ” on the screen. The program get an input from the user and store its value in the variable num3. The program displays the instruction “Enter the Fourth Number: ” on the screen. The program get an input from the user and store its value in the variable num4. The program will be continued on the next slide. display “Enter the Fourth Number: ” input num4 B A cube = num1 * num1 * num1 The program computes for the value of cube using the formula cube = num1 * num1 * num1.
  • 25. The program is continued. The program is terminated. B half = num2 / 2 The program computes for the value of half using the formula half = num2 / 2. twentyp = num3 * 0.20 END The program computes for the value of twentyp using the formula twentyp = num3 * 0.20. The program displays the value of cube on the screen. The program displays the value of half on the screen. The program displays the value of twentyp on the screen. times100 = num4 * 100 display cube display half display twentyp display times100 The program computes for the value of times100 using the formula times100 = num4 * 100. The program displays the value of times100 on the screen.
  • 26. PRACTICE TEST 1: DOLLAR TO PESO CONVERSION Create a flowchart for a program that will require the user to input the amount in US Dollars. Using the inputted amount, the program will convert it to its Philippine Peso value and display the answer on the screen. Note: 1 US Dollar = Php 56.78
  • 27. PRACTICE TEST 2: COMPUTING FOR AVERAGE Create a flowchart for a program that will require the user to input their grades in Mathematics, English, and Science. The program will compute for the average of the three grades and display its result on the computer screen.
  • 28. PRACTICE TEST 3: PLAYING WITH NUMBERS Create a flowchart for a program that will require the user to input four numbers. Using the inputs, the program will perform the following: ▪ display the 1st number, ▪ get the product of 1st and 3rd number, ▪ get the product of multiplying the 2nd number by the sum of the 3rd and 4th number, ▪ the average of the four numbers increased by 5.
  • 29. ALGORITHM AND FLOWCHARTING MR. ROWELL L. MARQUINA Professional Lecturer, Polytechnic University of the Philippines Email Address: [email protected] [email protected] [email protected]