Lesson 1 - Algorithm and Flowcharting.pdf

ROWELL MARQUINA
TUNASAN NATIONAL HIGH SCHOOL
SDO - Muntinlupa City
ROWELL L. MARQUINA
Senior High School Teacher
TUNASAN NATIONAL HIGH SCHOOL
Lesson 1 - Java Programming
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.
▪ Giving directions on how to get to
somebody’s house is an algorithm.
▪ Following a recipe for baking a cake is
an algorithm.
▪ The steps to compute the for average
is also an algorithm.
IMAGE SOURCE:
https://imgbin.com/png/uxvDNRys/computer-programming-computer-icons-technology-algorithm-png
https://www.flaticon.com/free-icon/coding_1085774
STEPS IN CREATING AN ALGORITHM
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.
IMAGE SOURCE:
https://imgbin.com/png/uxvDNRys/computer-programming-computer-icons-technology-algorithm-png
https://www.flaticon.com/free-icon/coding_1085774
STEPS IN CREATING AN ALGORITHM
After determining the output, the next
step is to identify the necessary
materials or elements needed to
accomplish the task.
The necessary materials or elements
for the program is called INPUT.
IMAGE SOURCE:
https://imgbin.com/png/uxvDNRys/computer-programming-computer-icons-technology-algorithm-png
https://www.flaticon.com/free-icon/coding_1085774
STEPS IN CREATING AN ALGORITHM
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.
IMAGE SOURCE:
https://imgbin.com/png/uxvDNRys/computer-programming-computer-icons-technology-algorithm-png
https://www.flaticon.com/free-icon/coding_1085774
Lesson 1 - Algorithm and Flowcharting.pdf
CHARACTERISTICS OF AN ALGORITHM
▪ 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.
IMAGE SOURCE:
https://imgbin.com/png/uxvDNRys/computer-programming-computer-icons-technology-algorithm-png
https://www.flaticon.com/free-icon/coding_1085774
Lesson 1 - Algorithm and Flowcharting.pdf
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 to document,
study, plan, improve and
communicate often complex
processes in clear, easy-to-
understand diagrams.
Lesson 1 - Algorithm and Flowcharting.pdf
FLOWCHART SYMBOLS
The American National
Standards Institute (ANSI) set
standards for flowcharts and
their symbols in the 1960s.
IMAGE SOURCE:
https://uploads-ssl.webflow.com/6184b461a39ff13bfb8c0556/61de99e8171cc6468145551d_flowchart-symbols-800.png
In 1970 the International
Organization for
Standardization (ISO)
adopted the ANSI symbols as
the international standard for
developing flowcharts.
FLOWCHART SYMBOLS
IMAGE SOURCE:
https://uploads-ssl.webflow.com/6184b461a39ff13bfb8c0556/61de99e8171cc6468145551d_flowchart-symbols-800.png
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.
FLOWCHART PROBLEM 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.
FLOWCHART SAMPLE
1:
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 are introduced to the program as integers.
The program displays the instruction “Enter Year of Birth: ” on 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.
FLOWCHART PROBLEM 2:
CONVERSION 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.
FLOWCHART SAMPLE
1:
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 are introduced to the program.
The program displays the instruction “Enter Weight in Kilogram:” on screen.
The program get an input from the user and store its value in the variable kilo.
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.
FLOWCHART PROBLEM 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.
FLOWCHART SAMPLE
1:
START
length, width, area
display
“Enter Length of the
Rectangle:”
input
length
display
“Enter Width of the
Rectangle:”
input
width
A
The program is initiated.
The variables length, width, and area are introduced to the program as integers.
The program displays the instruction “Enter Length of Rectangle: ” on screen .
The program get an input from the user and store its value in the variable length.
The program displays the instruction “Enter Width of Rectangle: ” on screen .
The program get an input from the user and store its value in the width.
The program will continue on the next part.
FLOWCHART SAMPLE
1:
A
area = length * width
display
area
END
The program continues.
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.
FLOWCHART PROBLEM 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
FLOWCHART SAMPLE
1:
START
a, b, c, d, sum, product, square
display
“Enter the First
Number:”
input
a
display
“Enter the Second
Number:”
input
b
A
The program is initiated.
The variables a, b, c, d, sum, product, and square are introduced to the program.
The program displays the instruction “Enter the First Number: ” on screen .
The program get an input from the user and store its value in the variable a.
The program displays the instruction “Enter the Second Number: ” on screen .
The program get an input from the user and store its value in the b.
The program will continue on the next part.
FLOWCHART SAMPLE
1: display
“Enter the Third
Number:”
input
c
display
“Enter the Fourth
Number:”
input
d
B
The program continues.
The program displays the instruction “Enter the Third Number: ” on screen .
The program get an input from the user and store its value in the variable c.
The program displays the instruction “Enter the Fourth Number: ” on screen .
The program get an input from the user and store its value in the d.
The program will continue on the next part.
A
FLOWCHART SAMPLE
1:
B
sum = a + b
The program continues.
The program computes for the value of sum using the formula sum = a + b.
product = c * d The program computes for the value of product using the formula product = c*d.
square = b * b The program computes for the value of square using the formula square = b*b.
display
sum
The program displays the value of sum on the screen.
display
product
The program displays the value of product on the screen.
display
square
The program displays the value of square on the screen.
END The program is terminated.
FLOWCHART PROBLEM 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
FLOWCHART SAMPLE
1:
START
display
“Enter the First
Number:”
input
a
display
“Enter the Second
Number:”
input
b
A
The program is initiated.
The variables a, b, c, d, cube, half, twentypercent, and times100 are
introduced to the program.
The program displays the instruction “Enter the First Number: ” on screen .
The program get an input from the user and store its value in the variable a.
The program displays the instruction “Enter the Second Number: ” on screen .
The program get an input from the user and store its value in the b.
The program will continue on the next part.
a, b, c, d, cube, half,
twentypercent, times100
FLOWCHART SAMPLE
1: display
“Enter the Third
Number:”
input
c
display
“Enter the Fourth
Number:”
input
d
B
The program continues.
The program displays the instruction “Enter the Third Number: ” on screen .
The program get an input from the user and store its value in the variable c.
The program displays the instruction “Enter the Fourth Number: ” on screen .
The program get an input from the user and store its value in the d.
The program will continue on the next part.
A
FLOWCHART SAMPLE
1:
B
cube = a*a*a
The program continues.
The program computes for the value of cube using the formula cube = a*a*a.
half = b / 2 The program computes for the value of half using the formula half = b / 2.
twentypercent = c * 0.20
The program computes for the value of twentypercent using the formula
twentypercent = c*0.20.
times100 = d * 100 The program computes for the value of times100 using the formula times100 = d*100.
display
cube
The program displays the value of cube on the screen.
display
half
The program displays the value of half on the screen.
C The program will continue on the next part.
FLOWCHART SAMPLE
1: C The program continues.
display
twentypercent
The program displays the value of twentypercent on the screen.
display
times100
The program displays the value of times100 on the screen.
END The program is terminated.
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
Tunasan National High School
Senior High School Department
Email Address:
rowell.marquina001@deped.gov.ph
sirrowellmarquina@gmail.com
rmarquina@mitis.edu.ph
1 sur 32

Recommandé

Lesson 3 - Displaying Text on Screen.pdf par
Lesson 3 - Displaying Text on Screen.pdfLesson 3 - Displaying Text on Screen.pdf
Lesson 3 - Displaying Text on Screen.pdfROWELL MARQUINA
209 vues18 diapositives
Lesson 5 - Getting Input from Users.pdf par
Lesson 5 - Getting Input from Users.pdfLesson 5 - Getting Input from Users.pdf
Lesson 5 - Getting Input from Users.pdfROWELL MARQUINA
223 vues25 diapositives
Java Programming - Conditional Statements (Switch).pdf par
Java Programming - Conditional Statements (Switch).pdfJava Programming - Conditional Statements (Switch).pdf
Java Programming - Conditional Statements (Switch).pdfROWELL MARQUINA
145 vues8 diapositives
Java Programming - Conditional Statements (If-Else).pdf par
Java Programming - Conditional Statements (If-Else).pdfJava Programming - Conditional Statements (If-Else).pdf
Java Programming - Conditional Statements (If-Else).pdfROWELL MARQUINA
207 vues8 diapositives
Java tutorial PPT par
Java tutorial PPTJava tutorial PPT
Java tutorial PPTIntelligo Technologies
177.5K vues55 diapositives
Introduction to Java -unit-1 par
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1RubaNagarajan
1.9K vues22 diapositives

Contenu connexe

Tendances

Hci final report par
Hci final reportHci final report
Hci final reporthciutm
2.3K vues11 diapositives
Summer training presentation on "CORE JAVA". par
Summer training presentation on "CORE JAVA".Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".SudhanshuVijay3
4.1K vues17 diapositives
Introduction to Java Programming, Basic Structure, variables Data type, input... par
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Mr. Akaash
3.6K vues45 diapositives
Java package par
Java packageJava package
Java packageCS_GDRCST
20.2K vues13 diapositives
Basic of Java par
Basic of JavaBasic of Java
Basic of JavaAjeet Kumar Verma
1.3K vues15 diapositives
Java Presentation par
Java PresentationJava Presentation
Java Presentationpm2214
17.3K vues28 diapositives

Tendances(20)

Hci final report par hciutm
Hci final reportHci final report
Hci final report
hciutm2.3K vues
Summer training presentation on "CORE JAVA". par SudhanshuVijay3
Summer training presentation on "CORE JAVA".Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".
SudhanshuVijay34.1K vues
Introduction to Java Programming, Basic Structure, variables Data type, input... par Mr. Akaash
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...
Mr. Akaash3.6K vues
Java package par CS_GDRCST
Java packageJava package
Java package
CS_GDRCST20.2K vues
Java Presentation par pm2214
Java PresentationJava Presentation
Java Presentation
pm221417.3K vues
Multithread Programing in Java par M. Raihan
Multithread Programing in JavaMultithread Programing in Java
Multithread Programing in Java
M. Raihan2.8K vues
Building visual basic application par Sara Corpuz
Building visual basic applicationBuilding visual basic application
Building visual basic application
Sara Corpuz761 vues
OOPs Concepts - Android Programming par Purvik Rana
OOPs Concepts - Android ProgrammingOOPs Concepts - Android Programming
OOPs Concepts - Android Programming
Purvik Rana4.5K vues
Inheritance in java par Tech_MX
Inheritance in javaInheritance in java
Inheritance in java
Tech_MX27.9K vues
Cobol programming language par Burhan Ahmed
Cobol programming languageCobol programming language
Cobol programming language
Burhan Ahmed2.9K vues
Character stream classes introd .51 par myrajendra
Character stream classes introd  .51Character stream classes introd  .51
Character stream classes introd .51
myrajendra2.2K vues
Assembler design options par Mohd Arif
Assembler design optionsAssembler design options
Assembler design options
Mohd Arif16.3K vues
2.1 project management srs par Anil Kumar
2.1 project management   srs2.1 project management   srs
2.1 project management srs
Anil Kumar6K vues
Android Synopsis par Niraj Rahi
Android SynopsisAndroid Synopsis
Android Synopsis
Niraj Rahi6.3K vues

Similaire à Lesson 1 - Algorithm and Flowcharting.pdf

DSA Lesson 2 - Algorithm and Flowcharting.pdf par
DSA Lesson 2 - Algorithm and Flowcharting.pdfDSA Lesson 2 - Algorithm and Flowcharting.pdf
DSA Lesson 2 - Algorithm and Flowcharting.pdfROWELL MARQUINA
169 vues29 diapositives
COMP 122 Entire Course NEW par
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEWshyamuopeight
11 vues33 diapositives
Program Description Basic User InterfaceThis program create.docx par
Program Description Basic User InterfaceThis program create.docxProgram Description Basic User InterfaceThis program create.docx
Program Description Basic User InterfaceThis program create.docxwkyra78
3 vues6 diapositives
Programming Fundamental handouts par
Programming Fundamental handoutsProgramming Fundamental handouts
Programming Fundamental handoutsInternational Islamic University
654 vues9 diapositives
C Programming Lab manual 18CPL17 par
C Programming Lab manual 18CPL17C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17manjurkts
18.4K vues36 diapositives
EC6612 VLSI Design Lab Manual par
EC6612 VLSI Design Lab ManualEC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab Manualtamil arasan
824 vues64 diapositives

Similaire à Lesson 1 - Algorithm and Flowcharting.pdf(20)

DSA Lesson 2 - Algorithm and Flowcharting.pdf par ROWELL MARQUINA
DSA Lesson 2 - Algorithm and Flowcharting.pdfDSA Lesson 2 - Algorithm and Flowcharting.pdf
DSA Lesson 2 - Algorithm and Flowcharting.pdf
ROWELL MARQUINA169 vues
Program Description Basic User InterfaceThis program create.docx par wkyra78
Program Description Basic User InterfaceThis program create.docxProgram Description Basic User InterfaceThis program create.docx
Program Description Basic User InterfaceThis program create.docx
wkyra783 vues
C Programming Lab manual 18CPL17 par manjurkts
C Programming Lab manual 18CPL17C Programming Lab manual 18CPL17
C Programming Lab manual 18CPL17
manjurkts18.4K vues
EC6612 VLSI Design Lab Manual par tamil arasan
EC6612 VLSI Design Lab ManualEC6612 VLSI Design Lab Manual
EC6612 VLSI Design Lab Manual
tamil arasan824 vues
CBCS 2018 Scheme I sem Lab Manual for 18CPL17 par manjurkts
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
manjurkts911 vues
California State University, Fullerton College of Engineerin.docx par humphrieskalyn
California State University, Fullerton College of Engineerin.docxCalifornia State University, Fullerton College of Engineerin.docx
California State University, Fullerton College of Engineerin.docx
Question 1 Write a program in C++ that declares two variables, an.pdf par AlphaVision2
 Question 1 Write a program in C++ that declares two variables, an.pdf Question 1 Write a program in C++ that declares two variables, an.pdf
Question 1 Write a program in C++ that declares two variables, an.pdf
AlphaVision221 vues
Cs2312 OOPS LAB MANUAL par Prabhu D
Cs2312 OOPS LAB MANUALCs2312 OOPS LAB MANUAL
Cs2312 OOPS LAB MANUAL
Prabhu D11.1K vues
CIS 170 Life of the Mind/newtonhelp.com    par llflowe
CIS 170 Life of the Mind/newtonhelp.com   CIS 170 Life of the Mind/newtonhelp.com   
CIS 170 Life of the Mind/newtonhelp.com   
llflowe20 vues
CIS 170 Imagine Your Future/newtonhelp.com    par bellflower42
CIS 170 Imagine Your Future/newtonhelp.com   CIS 170 Imagine Your Future/newtonhelp.com   
CIS 170 Imagine Your Future/newtonhelp.com   
bellflower4214 vues
Cis 170 Extraordinary Success/newtonhelp.com par amaranthbeg143
Cis 170 Extraordinary Success/newtonhelp.com  Cis 170 Extraordinary Success/newtonhelp.com
Cis 170 Extraordinary Success/newtonhelp.com
amaranthbeg14317 vues
CIS 170 Focus Dreams/newtonhelp.com par bellflower82
CIS 170 Focus Dreams/newtonhelp.comCIS 170 Focus Dreams/newtonhelp.com
CIS 170 Focus Dreams/newtonhelp.com
bellflower8212 vues
Cis355 a ilab 2 control structures and user defined methods devry university par sjskjd709707
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
sjskjd709707417 vues
ICT104 Programming Assignment Compiled By Divya Lee.docx par tarifarmarie
ICT104 Programming Assignment  Compiled By Divya Lee.docxICT104 Programming Assignment  Compiled By Divya Lee.docx
ICT104 Programming Assignment Compiled By Divya Lee.docx
tarifarmarie2 vues
CIS 170 Inspiring Innovation/tutorialrank.com par jonhson110
 CIS 170 Inspiring Innovation/tutorialrank.com CIS 170 Inspiring Innovation/tutorialrank.com
CIS 170 Inspiring Innovation/tutorialrank.com
jonhson11022 vues
Cis 355 i lab 4 of 6 par helpido9
Cis 355 i lab 4 of 6Cis 355 i lab 4 of 6
Cis 355 i lab 4 of 6
helpido9100 vues
Cis 355 ilab 4 of 6 par comp274
Cis 355 ilab 4 of 6Cis 355 ilab 4 of 6
Cis 355 ilab 4 of 6
comp274197 vues

Plus de ROWELL MARQUINA

ITSP Lesson 1 - Ethics and Ethical Theories.pdf par
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfROWELL MARQUINA
160 vues49 diapositives
ITSP Lesson 1 - Ethics and Ethical Theories.pdf par
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdfROWELL MARQUINA
153 vues40 diapositives
CHF Lesson 2 - Software and Software Categories.pdf par
CHF Lesson 2 - Software and Software Categories.pdfCHF Lesson 2 - Software and Software Categories.pdf
CHF Lesson 2 - Software and Software Categories.pdfROWELL MARQUINA
194 vues22 diapositives
Animation Lesson 4 - Tools and Equipment in Animation.pdf par
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
146 vues20 diapositives
DSA Lesson 1 - Introduction to Data Structures.pdf par
DSA Lesson 1 - Introduction to Data Structures.pdfDSA Lesson 1 - Introduction to Data Structures.pdf
DSA Lesson 1 - Introduction to Data Structures.pdfROWELL MARQUINA
154 vues36 diapositives
Lesson 1 - Introduction to Programming .pdf par
Lesson 1 - Introduction to Programming .pdfLesson 1 - Introduction to Programming .pdf
Lesson 1 - Introduction to Programming .pdfROWELL MARQUINA
145 vues30 diapositives

Plus de ROWELL MARQUINA(12)

ITSP Lesson 1 - Ethics and Ethical Theories.pdf par ROWELL MARQUINA
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ROWELL MARQUINA160 vues
ITSP Lesson 1 - Ethics and Ethical Theories.pdf par ROWELL MARQUINA
ITSP Lesson 1 - Ethics and Ethical Theories.pdfITSP Lesson 1 - Ethics and Ethical Theories.pdf
ITSP Lesson 1 - Ethics and Ethical Theories.pdf
ROWELL MARQUINA153 vues
CHF Lesson 2 - Software and Software Categories.pdf par ROWELL MARQUINA
CHF Lesson 2 - Software and Software Categories.pdfCHF Lesson 2 - Software and Software Categories.pdf
CHF Lesson 2 - Software and Software Categories.pdf
ROWELL MARQUINA194 vues
Animation Lesson 4 - Tools and Equipment in Animation.pdf par ROWELL MARQUINA
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
ROWELL MARQUINA146 vues
DSA Lesson 1 - Introduction to Data Structures.pdf par ROWELL MARQUINA
DSA Lesson 1 - Introduction to Data Structures.pdfDSA Lesson 1 - Introduction to Data Structures.pdf
DSA Lesson 1 - Introduction to Data Structures.pdf
ROWELL MARQUINA154 vues
Lesson 1 - Introduction to Programming .pdf par ROWELL MARQUINA
Lesson 1 - Introduction to Programming .pdfLesson 1 - Introduction to Programming .pdf
Lesson 1 - Introduction to Programming .pdf
ROWELL MARQUINA145 vues
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf par ROWELL MARQUINA
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
ROWELL MARQUINA361 vues
Animation Lesson 2 - Environment and Market (Updated).pdf par ROWELL MARQUINA
Animation Lesson 2 - Environment and Market (Updated).pdfAnimation Lesson 2 - Environment and Market (Updated).pdf
Animation Lesson 2 - Environment and Market (Updated).pdf
ROWELL MARQUINA223 vues
Animation Lesson 3 - Occupational Health and Safety Procedures.pdf par ROWELL MARQUINA
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
ROWELL MARQUINA2.3K vues
Personal Entrepreneurial Competencies (PECs).pdf par ROWELL MARQUINA
Personal Entrepreneurial Competencies (PECs).pdfPersonal Entrepreneurial Competencies (PECs).pdf
Personal Entrepreneurial Competencies (PECs).pdf
ROWELL MARQUINA216 vues

Dernier

Microsoft Power Platform.pptx par
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptxUni Systems S.M.S.A.
53 vues38 diapositives
Ransomware is Knocking your Door_Final.pdf par
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdfSecurity Bootcamp
55 vues46 diapositives
Kyo - Functional Scala 2023.pdf par
Kyo - Functional Scala 2023.pdfKyo - Functional Scala 2023.pdf
Kyo - Functional Scala 2023.pdfFlavio W. Brasil
368 vues92 diapositives
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... par
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc
10 vues29 diapositives
Special_edition_innovator_2023.pdf par
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdfWillDavies22
17 vues6 diapositives
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive par
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveNetwork Automation Forum
31 vues35 diapositives

Dernier(20)

TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... par TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc10 vues
Special_edition_innovator_2023.pdf par WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2217 vues
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive par Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Unit 1_Lecture 2_Physical Design of IoT.pdf par StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 vues
Serverless computing with Google Cloud (2023-24) par wesley chun
Serverless computing with Google Cloud (2023-24)Serverless computing with Google Cloud (2023-24)
Serverless computing with Google Cloud (2023-24)
wesley chun11 vues
STPI OctaNE CoE Brochure.pdf par madhurjyapb
STPI OctaNE CoE Brochure.pdfSTPI OctaNE CoE Brochure.pdf
STPI OctaNE CoE Brochure.pdf
madhurjyapb14 vues
Case Study Copenhagen Energy and Business Central.pdf par Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana16 vues
Future of AR - Facebook Presentation par ssuserb54b561
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
ssuserb54b56114 vues
Igniting Next Level Productivity with AI-Infused Data Integration Workflows par Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software263 vues
Voice Logger - Telephony Integration Solution at Aegis par Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma39 vues

Lesson 1 - Algorithm and Flowcharting.pdf

  • 1. TUNASAN NATIONAL HIGH SCHOOL SDO - Muntinlupa City ROWELL L. MARQUINA Senior High School Teacher TUNASAN NATIONAL HIGH SCHOOL Lesson 1 - Java Programming
  • 2. 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. ▪ Giving directions on how to get to somebody’s house is an algorithm. ▪ Following a recipe for baking a cake is an algorithm. ▪ The steps to compute the for average is also an algorithm. IMAGE SOURCE: https://imgbin.com/png/uxvDNRys/computer-programming-computer-icons-technology-algorithm-png https://www.flaticon.com/free-icon/coding_1085774
  • 3. STEPS IN CREATING AN ALGORITHM 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. IMAGE SOURCE: https://imgbin.com/png/uxvDNRys/computer-programming-computer-icons-technology-algorithm-png https://www.flaticon.com/free-icon/coding_1085774
  • 4. STEPS IN CREATING AN ALGORITHM After determining the output, the next step is to identify the necessary materials or elements needed to accomplish the task. The necessary materials or elements for the program is called INPUT. IMAGE SOURCE: https://imgbin.com/png/uxvDNRys/computer-programming-computer-icons-technology-algorithm-png https://www.flaticon.com/free-icon/coding_1085774
  • 5. STEPS IN CREATING AN ALGORITHM 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. IMAGE SOURCE: https://imgbin.com/png/uxvDNRys/computer-programming-computer-icons-technology-algorithm-png https://www.flaticon.com/free-icon/coding_1085774
  • 7. CHARACTERISTICS OF AN ALGORITHM ▪ 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. IMAGE SOURCE: https://imgbin.com/png/uxvDNRys/computer-programming-computer-icons-technology-algorithm-png https://www.flaticon.com/free-icon/coding_1085774
  • 9. 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 to document, study, plan, improve and communicate often complex processes in clear, easy-to- understand diagrams.
  • 11. FLOWCHART SYMBOLS The American National Standards Institute (ANSI) set standards for flowcharts and their symbols in the 1960s. IMAGE SOURCE: https://uploads-ssl.webflow.com/6184b461a39ff13bfb8c0556/61de99e8171cc6468145551d_flowchart-symbols-800.png In 1970 the International Organization for Standardization (ISO) adopted the ANSI symbols as the international standard for developing flowcharts.
  • 12. FLOWCHART SYMBOLS IMAGE SOURCE: https://uploads-ssl.webflow.com/6184b461a39ff13bfb8c0556/61de99e8171cc6468145551d_flowchart-symbols-800.png 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.
  • 13. FLOWCHART PROBLEM 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.
  • 14. FLOWCHART SAMPLE 1: 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 are introduced to the program as integers. The program displays the instruction “Enter Year of Birth: ” on 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.
  • 15. FLOWCHART PROBLEM 2: CONVERSION 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.
  • 16. FLOWCHART SAMPLE 1: 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 are introduced to the program. The program displays the instruction “Enter Weight in Kilogram:” on screen. The program get an input from the user and store its value in the variable kilo. 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.
  • 17. FLOWCHART PROBLEM 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.
  • 18. FLOWCHART SAMPLE 1: START length, width, area display “Enter Length of the Rectangle:” input length display “Enter Width of the Rectangle:” input width A The program is initiated. The variables length, width, and area are introduced to the program as integers. The program displays the instruction “Enter Length of Rectangle: ” on screen . The program get an input from the user and store its value in the variable length. The program displays the instruction “Enter Width of Rectangle: ” on screen . The program get an input from the user and store its value in the width. The program will continue on the next part.
  • 19. FLOWCHART SAMPLE 1: A area = length * width display area END The program continues. 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.
  • 20. FLOWCHART PROBLEM 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
  • 21. FLOWCHART SAMPLE 1: START a, b, c, d, sum, product, square display “Enter the First Number:” input a display “Enter the Second Number:” input b A The program is initiated. The variables a, b, c, d, sum, product, and square are introduced to the program. The program displays the instruction “Enter the First Number: ” on screen . The program get an input from the user and store its value in the variable a. The program displays the instruction “Enter the Second Number: ” on screen . The program get an input from the user and store its value in the b. The program will continue on the next part.
  • 22. FLOWCHART SAMPLE 1: display “Enter the Third Number:” input c display “Enter the Fourth Number:” input d B The program continues. The program displays the instruction “Enter the Third Number: ” on screen . The program get an input from the user and store its value in the variable c. The program displays the instruction “Enter the Fourth Number: ” on screen . The program get an input from the user and store its value in the d. The program will continue on the next part. A
  • 23. FLOWCHART SAMPLE 1: B sum = a + b The program continues. The program computes for the value of sum using the formula sum = a + b. product = c * d The program computes for the value of product using the formula product = c*d. square = b * b The program computes for the value of square using the formula square = b*b. display sum The program displays the value of sum on the screen. display product The program displays the value of product on the screen. display square The program displays the value of square on the screen. END The program is terminated.
  • 24. FLOWCHART PROBLEM 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
  • 25. FLOWCHART SAMPLE 1: START display “Enter the First Number:” input a display “Enter the Second Number:” input b A The program is initiated. The variables a, b, c, d, cube, half, twentypercent, and times100 are introduced to the program. The program displays the instruction “Enter the First Number: ” on screen . The program get an input from the user and store its value in the variable a. The program displays the instruction “Enter the Second Number: ” on screen . The program get an input from the user and store its value in the b. The program will continue on the next part. a, b, c, d, cube, half, twentypercent, times100
  • 26. FLOWCHART SAMPLE 1: display “Enter the Third Number:” input c display “Enter the Fourth Number:” input d B The program continues. The program displays the instruction “Enter the Third Number: ” on screen . The program get an input from the user and store its value in the variable c. The program displays the instruction “Enter the Fourth Number: ” on screen . The program get an input from the user and store its value in the d. The program will continue on the next part. A
  • 27. FLOWCHART SAMPLE 1: B cube = a*a*a The program continues. The program computes for the value of cube using the formula cube = a*a*a. half = b / 2 The program computes for the value of half using the formula half = b / 2. twentypercent = c * 0.20 The program computes for the value of twentypercent using the formula twentypercent = c*0.20. times100 = d * 100 The program computes for the value of times100 using the formula times100 = d*100. display cube The program displays the value of cube on the screen. display half The program displays the value of half on the screen. C The program will continue on the next part.
  • 28. FLOWCHART SAMPLE 1: C The program continues. display twentypercent The program displays the value of twentypercent on the screen. display times100 The program displays the value of times100 on the screen. END The program is terminated.
  • 29. 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
  • 30. 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.
  • 31. 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.
  • 32. ALGORITHM AND FLOWCHARTING MR. ROWELL L. MARQUINA Tunasan National High School Senior High School Department Email Address: rowell.marquina001@deped.gov.ph sirrowellmarquina@gmail.com rmarquina@mitis.edu.ph