SlideShare a Scribd company logo
1 of 29
Download to read offline
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

File based approach
File based approachFile based approach
File based approachPreethaAS
 
Introduction to Assembly Language
Introduction to Assembly LanguageIntroduction to Assembly Language
Introduction to Assembly LanguageMotaz Saad
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1Manoj Patil
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case DiagramAshesh R
 
diffrence between procedure oriented programming & object oriented programmin...
diffrence between procedure oriented programming & object oriented programmin...diffrence between procedure oriented programming & object oriented programmin...
diffrence between procedure oriented programming & object oriented programmin...nihar joshi
 
Assemblers: Ch03
Assemblers: Ch03Assemblers: Ch03
Assemblers: Ch03desta_gebre
 
Overloading and overriding in vb.net
Overloading and overriding in vb.netOverloading and overriding in vb.net
Overloading and overriding in vb.netsuraj pandey
 
OOP in C++
OOP in C++OOP in C++
OOP in C++ppd1961
 
Modules and modularization criteria
Modules and modularization criteriaModules and modularization criteria
Modules and modularization criteriaUmaselvi_R
 
Error handling and debugging in vb
Error handling and debugging in vbError handling and debugging in vb
Error handling and debugging in vbSalim M
 
Command line arguments
Command line argumentsCommand line arguments
Command line argumentsAshok Raj
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programmingAkshay Ithape
 
Designing Techniques in Software Engineering
Designing Techniques in Software EngineeringDesigning Techniques in Software Engineering
Designing Techniques in Software Engineeringkirupasuchi1996
 
Python intro
Python introPython intro
Python introrik0
 

What's hot (20)

File based approach
File based approachFile based approach
File based approach
 
Introduction to Assembly Language
Introduction to Assembly LanguageIntroduction to Assembly Language
Introduction to Assembly Language
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 
diffrence between procedure oriented programming & object oriented programmin...
diffrence between procedure oriented programming & object oriented programmin...diffrence between procedure oriented programming & object oriented programmin...
diffrence between procedure oriented programming & object oriented programmin...
 
Assemblers: Ch03
Assemblers: Ch03Assemblers: Ch03
Assemblers: Ch03
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Overloading and overriding in vb.net
Overloading and overriding in vb.netOverloading and overriding in vb.net
Overloading and overriding in vb.net
 
COCOMO model
COCOMO modelCOCOMO model
COCOMO model
 
c-programming
c-programmingc-programming
c-programming
 
OOP in C++
OOP in C++OOP in C++
OOP in C++
 
Modules and modularization criteria
Modules and modularization criteriaModules and modularization criteria
Modules and modularization criteria
 
database
databasedatabase
database
 
Error handling and debugging in vb
Error handling and debugging in vbError handling and debugging in vb
Error handling and debugging in vb
 
Getting started with wxWidgets
Getting started with wxWidgets Getting started with wxWidgets
Getting started with wxWidgets
 
Command line arguments
Command line argumentsCommand line arguments
Command line arguments
 
Introduction to c programming
Introduction to c programmingIntroduction to c programming
Introduction to c programming
 
Direct linking loaders
Direct linking loadersDirect linking loaders
Direct linking loaders
 
Designing Techniques in Software Engineering
Designing Techniques in Software EngineeringDesigning Techniques in Software Engineering
Designing Techniques in Software Engineering
 
Python intro
Python introPython intro
Python intro
 

Similar to DSA Lesson 2 - Algorithm and Flowcharting.pdf

Lesson 1 - Algorithm and Flowcharting.pdf
Lesson 1 - Algorithm and Flowcharting.pdfLesson 1 - Algorithm and Flowcharting.pdf
Lesson 1 - Algorithm and Flowcharting.pdfROWELL MARQUINA
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEWshyamuopeight
 
Lesson 5 - Getting Input from Users.pdf
Lesson 5 - Getting Input from Users.pdfLesson 5 - Getting Input from Users.pdf
Lesson 5 - Getting Input from Users.pdfROWELL MARQUINA
 
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docxBottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docxAASTHA76
 
C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17manjurkts
 
California State University, Fullerton College of Engineerin.docx
California State University, Fullerton College of Engineerin.docxCalifornia State University, Fullerton College of Engineerin.docx
California State University, Fullerton College of Engineerin.docxhumphrieskalyn
 
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 manjurkts
 
EC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab ManualEC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab Manualtamil arasan
 
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docxCMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docxclarebernice
 
Project 2Project 2.pdfIntroduction to Programming EECS 1.docx
Project 2Project 2.pdfIntroduction to Programming  EECS 1.docxProject 2Project 2.pdfIntroduction to Programming  EECS 1.docx
Project 2Project 2.pdfIntroduction to Programming EECS 1.docxwkyra78
 
c++ Question
c++  Questionc++  Question
c++ QuestionHamza4467
 
Year 2 dsa c++ exercises on user defined functions
Year 2 dsa  c++ exercises on user defined functionsYear 2 dsa  c++ exercises on user defined functions
Year 2 dsa c++ exercises on user defined functionsErnesteNtezirizaza
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsnoahjamessss
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringscskvsmi44
 
CIS 170 Life of the Mind/newtonhelp.com   
CIS 170 Life of the Mind/newtonhelp.com   CIS 170 Life of the Mind/newtonhelp.com   
CIS 170 Life of the Mind/newtonhelp.com   llflowe
 
CIS 170 Imagine Your Future/newtonhelp.com   
CIS 170 Imagine Your Future/newtonhelp.com   CIS 170 Imagine Your Future/newtonhelp.com   
CIS 170 Imagine Your Future/newtonhelp.com   bellflower42
 
INTRODUCTION The goal of this programming project is to entble studen.pdf
 INTRODUCTION The goal of this programming project is to entble studen.pdf INTRODUCTION The goal of this programming project is to entble studen.pdf
INTRODUCTION The goal of this programming project is to entble studen.pdfameancal
 
Cis355 a ilab 2 control structures and user defined methods devry university
Cis355 a ilab 2 control structures and user defined methods devry universityCis355 a ilab 2 control structures and user defined methods devry university
Cis355 a ilab 2 control structures and user defined methods devry universitysjskjd709707
 

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

Lesson 1 - Algorithm and Flowcharting.pdf
Lesson 1 - Algorithm and Flowcharting.pdfLesson 1 - Algorithm and Flowcharting.pdf
Lesson 1 - Algorithm and Flowcharting.pdf
 
Programming Fundamental handouts
Programming Fundamental handoutsProgramming Fundamental handouts
Programming Fundamental handouts
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
 
Lesson 5 - Getting Input from Users.pdf
Lesson 5 - Getting Input from Users.pdfLesson 5 - Getting Input from Users.pdf
Lesson 5 - Getting Input from Users.pdf
 
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docxBottom of FormCreate your own FunctionFunctionsFor eac.docx
Bottom of FormCreate your own FunctionFunctionsFor eac.docx
 
C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17
 
California State University, Fullerton College of Engineerin.docx
California State University, Fullerton College of Engineerin.docxCalifornia State University, Fullerton College of Engineerin.docx
California State University, Fullerton College of Engineerin.docx
 
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 CBCS 2018 Scheme I sem Lab Manual for 18CPL17
CBCS 2018 Scheme I sem Lab Manual for 18CPL17
 
EC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab ManualEC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab Manual
 
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docxCMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
 
Chapter 2- Prog101.ppt
Chapter 2- Prog101.pptChapter 2- Prog101.ppt
Chapter 2- Prog101.ppt
 
Project 2Project 2.pdfIntroduction to Programming EECS 1.docx
Project 2Project 2.pdfIntroduction to Programming  EECS 1.docxProject 2Project 2.pdfIntroduction to Programming  EECS 1.docx
Project 2Project 2.pdfIntroduction to Programming EECS 1.docx
 
c++ Question
c++  Questionc++  Question
c++ Question
 
Year 2 dsa c++ exercises on user defined functions
Year 2 dsa  c++ exercises on user defined functionsYear 2 dsa  c++ exercises on user defined functions
Year 2 dsa c++ exercises on user defined functions
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-stringsDevry cis-170-c-i lab-5-of-7-arrays-and-strings
Devry cis-170-c-i lab-5-of-7-arrays-and-strings
 
CIS 170 Life of the Mind/newtonhelp.com   
CIS 170 Life of the Mind/newtonhelp.com   CIS 170 Life of the Mind/newtonhelp.com   
CIS 170 Life of the Mind/newtonhelp.com   
 
CIS 170 Imagine Your Future/newtonhelp.com   
CIS 170 Imagine Your Future/newtonhelp.com   CIS 170 Imagine Your Future/newtonhelp.com   
CIS 170 Imagine Your Future/newtonhelp.com   
 
INTRODUCTION The goal of this programming project is to entble studen.pdf
 INTRODUCTION The goal of this programming project is to entble studen.pdf INTRODUCTION The goal of this programming project is to entble studen.pdf
INTRODUCTION The goal of this programming project is to entble studen.pdf
 
Cis355 a ilab 2 control structures and user defined methods devry university
Cis355 a ilab 2 control structures and user defined methods devry universityCis355 a ilab 2 control structures and user defined methods devry university
Cis355 a ilab 2 control structures and user defined methods devry university
 

More from ROWELL MARQUINA

QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfROWELL MARQUINA
 
QMMS Lesson 2 - Using Excel Formula.pptx
QMMS Lesson 2 - Using Excel Formula.pptxQMMS Lesson 2 - Using Excel Formula.pptx
QMMS Lesson 2 - Using Excel Formula.pptxROWELL MARQUINA
 
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdfHCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdfROWELL MARQUINA
 
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdfHCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdfROWELL MARQUINA
 
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdfDS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdfROWELL MARQUINA
 
ITSP Lesson 6 - Information Privacy.pdf
ITSP Lesson 6 - Information Privacy.pdfITSP Lesson 6 - Information Privacy.pdf
ITSP Lesson 6 - Information Privacy.pdfROWELL MARQUINA
 
ITSP Lesson 5 - Intellectual Property Rights.pdf
ITSP Lesson 5 - Intellectual Property Rights.pdfITSP Lesson 5 - Intellectual Property Rights.pdf
ITSP Lesson 5 - Intellectual Property Rights.pdfROWELL MARQUINA
 
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfROWELL MARQUINA
 
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfROWELL MARQUINA
 
CHF Lesson 2 - Software and Software Categories.pdf
CHF Lesson 2 - Software and Software Categories.pdfCHF Lesson 2 - Software and Software Categories.pdf
CHF Lesson 2 - Software and Software Categories.pdfROWELL MARQUINA
 
Animation Lesson 4 - Tools and Equipment in Animation.pdf
Animation Lesson 4 - Tools and Equipment in Animation.pdfAnimation Lesson 4 - Tools and Equipment in Animation.pdf
Animation Lesson 4 - Tools and Equipment in Animation.pdfROWELL MARQUINA
 
DSA Lesson 1 - Introduction to Data Structures.pdf
DSA Lesson 1 - Introduction to Data Structures.pdfDSA Lesson 1 - Introduction to Data Structures.pdf
DSA Lesson 1 - Introduction to Data Structures.pdfROWELL MARQUINA
 
Java Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdfJava Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdfROWELL MARQUINA
 
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdfAnimation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdfROWELL MARQUINA
 
Animation Lesson 2 - Environment and Market (Updated).pdf
Animation Lesson 2 - Environment and Market (Updated).pdfAnimation Lesson 2 - Environment and Market (Updated).pdf
Animation Lesson 2 - Environment and Market (Updated).pdfROWELL MARQUINA
 
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdfAnimation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdfROWELL MARQUINA
 
Personal Entrepreneurial Competencies (PECs).pdf
Personal Entrepreneurial Competencies (PECs).pdfPersonal Entrepreneurial Competencies (PECs).pdf
Personal Entrepreneurial Competencies (PECs).pdfROWELL MARQUINA
 
Environment and Market.pdf
Environment and Market.pdfEnvironment and Market.pdf
Environment and Market.pdfROWELL MARQUINA
 
Lesson 4 - Data and Variables.pdf
Lesson 4 - Data and Variables.pdfLesson 4 - Data and Variables.pdf
Lesson 4 - Data and Variables.pdfROWELL MARQUINA
 
Lesson 3 - Displaying Text on Screen.pdf
Lesson 3 - Displaying Text on Screen.pdfLesson 3 - Displaying Text on Screen.pdf
Lesson 3 - Displaying Text on Screen.pdfROWELL MARQUINA
 

More from ROWELL MARQUINA (20)

QMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdfQMMS Lesson 2 - Using MS Excel Formula.pdf
QMMS Lesson 2 - Using MS Excel Formula.pdf
 
QMMS Lesson 2 - Using Excel Formula.pptx
QMMS Lesson 2 - Using Excel Formula.pptxQMMS Lesson 2 - Using Excel Formula.pptx
QMMS Lesson 2 - Using Excel Formula.pptx
 
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdfHCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
HCI Lesson 2 - Components of Human-Computer Interaction (HCI).pdf
 
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdfHCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
HCI Lesson 1 - Introduction to Human-Computer Interaction.pdf
 
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdfDS Lesson 2 - Subsets, Supersets and Power Set.pdf
DS Lesson 2 - Subsets, Supersets and Power Set.pdf
 
ITSP Lesson 6 - Information Privacy.pdf
ITSP Lesson 6 - Information Privacy.pdfITSP Lesson 6 - Information Privacy.pdf
ITSP Lesson 6 - Information Privacy.pdf
 
ITSP Lesson 5 - Intellectual Property Rights.pdf
ITSP Lesson 5 - Intellectual Property Rights.pdfITSP Lesson 5 - Intellectual Property Rights.pdf
ITSP Lesson 5 - Intellectual Property Rights.pdf
 
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
 
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
 
CHF Lesson 2 - Software and Software Categories.pdf
CHF Lesson 2 - Software and Software Categories.pdfCHF Lesson 2 - Software and Software Categories.pdf
CHF Lesson 2 - Software and Software Categories.pdf
 
Animation Lesson 4 - Tools and Equipment in Animation.pdf
Animation Lesson 4 - Tools and Equipment in Animation.pdfAnimation Lesson 4 - Tools and Equipment in Animation.pdf
Animation Lesson 4 - Tools and Equipment in Animation.pdf
 
DSA Lesson 1 - Introduction to Data Structures.pdf
DSA Lesson 1 - Introduction to Data Structures.pdfDSA Lesson 1 - Introduction to Data Structures.pdf
DSA Lesson 1 - Introduction to Data Structures.pdf
 
Java Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdfJava Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdf
 
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdfAnimation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
 
Animation Lesson 2 - Environment and Market (Updated).pdf
Animation Lesson 2 - Environment and Market (Updated).pdfAnimation Lesson 2 - Environment and Market (Updated).pdf
Animation Lesson 2 - Environment and Market (Updated).pdf
 
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdfAnimation Lesson 3 - Occupational Health and Safety Procedures.pdf
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf
 
Personal Entrepreneurial Competencies (PECs).pdf
Personal Entrepreneurial Competencies (PECs).pdfPersonal Entrepreneurial Competencies (PECs).pdf
Personal Entrepreneurial Competencies (PECs).pdf
 
Environment and Market.pdf
Environment and Market.pdfEnvironment and Market.pdf
Environment and Market.pdf
 
Lesson 4 - Data and Variables.pdf
Lesson 4 - Data and Variables.pdfLesson 4 - Data and Variables.pdf
Lesson 4 - Data and Variables.pdf
 
Lesson 3 - Displaying Text on Screen.pdf
Lesson 3 - Displaying Text on Screen.pdfLesson 3 - Displaying Text on Screen.pdf
Lesson 3 - Displaying Text on Screen.pdf
 

Recently uploaded

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 

Recently uploaded (20)

Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 

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: rowell.marquina001@deped.gov.ph sirrowellmarquina@gmail.com rmarquina@mitis.edu.ph