SlideShare a Scribd company logo
pseudocode and Flowchart
What is pseudocode?
 List of steps written in English
 Like the instructions for a recipe
 Must be in the right sequence
 Imagine saying “bake the cake” and then “mix it up”
Sample Pseudocode
 Task: add two numbers
 Pseudocode:
 Start
 Get two numbers
 Get first number
 Get second number
 Add them
 Print the answer
 End
Invitation to Computer Science,
Java Version, Third Edition 4
Pseudocode
 English language constructs modeled to look like
statements available in most programming
languages
 Steps presented in a structured manner
(numbered, indented, and so on)
 No fixed syntax for most operations is required
Invitation to Computer Science,
Java Version, Third Edition 5
Pseudocode (continued)
 Less ambiguous and more readable than natural
language
 Emphasis is on process, not notation
 Well-understood forms allow logical reasoning
about algorithm behavior
 Can be easily translated into a programming
language
Sample Pseudocode
 Task: add two numbers
 Pseudocode:
 Start
 Get two numbers
 Get first number
 Get second number
 Add them
 Print the answer
 End
What does a flowchart look like?
 The pseudocode from the previous slide would look
like this as a flowchart:
Start
Get 2 numbers
Add them
Print answer
End
What are those funny symbols?
 START/END
 INPUT/OUTPUT
 PROCESS
 DECISION
What are those funny symbols?
 START/END
 Used at the beginning
and end of each
flowchart.
 INPUT/OUTPUT
 Shows when
information/data comes
into a program or is
printed out.
What are those funny symbols?
What are those funny symbols?
 PROCESS
 Used to show
calculations, storing of
data in variables, and
other “processes” that
take place within a
program.
What are those funny symbols?
What are those funny symbols?
 DECISION
 Used to show that the
program must decide
whether something
(usually a comparison
between numbers) is
true or false. YES and
NO (or T/F) branches
are usually shown.
What are those funny symbols?
Y
N
X>7?
Another Sample:
Calculating Age
 Pseudocode:
 Start
 Get year DOB
 Calculate age = (sysdate-DOB)
 Print age
 If age > 50 print OLD
 End
Another Sample:
Calculating Age
 Flowchart
 Start
 Get year born
 Calculate age
 Print age
 If age > 50 print OLD
 End
Get yr
Calc age
Print age
Age>50?OLD Y
N
Start
End
Self-Check
 Look at the flowchart section below. If the variable X is
5, what will print (K or 1st)?
X > 5?
YN
Print “1st”Print “K”
Self-Check
 Look at the flowchart section below. If the variable X is
5, what will print (K or 1st)?
X > 5?
YN
Print “1st”Print “K”
K will be printed. The answer to the question “Is X greater than 5?”
is NO, since X is equal to (not greater than) 5.
Self-Check
 Choose the correct
flowchart symbol for each
of these statements.
 AGE>65?
 Calc. Tax
 START
 Print NAME
Self-Check
 Choose the correct
flowchart symbol for each
of these statements.
 AGE>65?
 Calc. Tax
 START
 Print NAME
Challenge
 Try to write pseudocode and create a flowchart for a
program that calculates the average of three grades
and prints the average.
 The word GOOD should be printed only if the average
is more than 80.
Challenge
 Possible pseudocode
 Start
 Get three grades
 Average them (add all of them / number of grads taken)
 Print Average
 Average>80?
 If Yes, print GOOD
 End
Challenge
 Possible flowchart
 Start
 Get three grades
 Average them
 Print Average
 Average>80?
 If Yes, print GOOD
 End
START
END
Get 3 grades
Calc avg
Print avg
Avg>80?GOOD
Y
N
Challenge
 Try to write pseudocode and create a flowchart for a
program that calculates the average of three grades
and prints the average.
 The word GOOD should be printed only if the average
is more than 80.
Challenge
 Possible pseudocode
 Start
 Get three grades
 Average them
 Print Average
 Average>80?
 If Yes, print GOOD
 End
Challenge
 Possible flowchart
 Start
 Get three grades
 Average them
 Print Average
 Average>80?
 If Yes, print GOOD
 End
START
END
Get 3 grades
Calc avg
Print avg
Avg>80?GOOD
Y
N
pseudocode and Flowchart
 Algorithm for Computing Average Miles per
Gallon
pseudocode and Flowchart
 Write a program to do the task: Print a list of the numbers
from 4 to 9, next to each number, print the square of the
number.
pseudocode and Flowchart
pseudocode and Flowchart

More Related Content

What's hot (20)

DOCX
Microsoft Word - Basics Lesson Plan.docx
charitorivera3
 
PPTX
Programming Fundamentals lecture 1
REHAN IJAZ
 
PPT
Pseudocode algorithim flowchart
fika sweety
 
PPTX
Algorithm and flowchart
Shivam Sharma
 
PPTX
Programming Fundamentals
Trivuz ত্রিভুজ
 
PPTX
Python Exception Handling
Megha V
 
PPT
Program logic and design
Chaffey College
 
PPSX
Algorithm and flowchart
Sachin Goyani
 
PPTX
Basic Computer Programming
Allen de Castro
 
PPTX
Parts of a computer
Amit Jaglan
 
PPT
Assembling and deassembling
Online
 
PPT
Programming in c
indra Kishor
 
PPSX
Computer repair and maintenance
Cornelius Micah
 
PPT
Basic computer maintenance
geepatty
 
PPTX
Flowcharts and algorithms
Student
 
PPTX
Algorithms and Flowcharts
Deva Singh
 
PPTX
Introduction to flowchart
Jordan Delacruz
 
PPTX
Computer Hardware: Parts & Functions
Ray Monterola
 
PPTX
Programming paradigm
busyking03
 
PPTX
Theory of programming
tcc_joemarie
 
Microsoft Word - Basics Lesson Plan.docx
charitorivera3
 
Programming Fundamentals lecture 1
REHAN IJAZ
 
Pseudocode algorithim flowchart
fika sweety
 
Algorithm and flowchart
Shivam Sharma
 
Programming Fundamentals
Trivuz ত্রিভুজ
 
Python Exception Handling
Megha V
 
Program logic and design
Chaffey College
 
Algorithm and flowchart
Sachin Goyani
 
Basic Computer Programming
Allen de Castro
 
Parts of a computer
Amit Jaglan
 
Assembling and deassembling
Online
 
Programming in c
indra Kishor
 
Computer repair and maintenance
Cornelius Micah
 
Basic computer maintenance
geepatty
 
Flowcharts and algorithms
Student
 
Algorithms and Flowcharts
Deva Singh
 
Introduction to flowchart
Jordan Delacruz
 
Computer Hardware: Parts & Functions
Ray Monterola
 
Programming paradigm
busyking03
 
Theory of programming
tcc_joemarie
 

Similar to pseudocode and Flowchart (20)

PPTX
Programming fundamentals lecture 3
Raja Hamid
 
PPT
Programming
Leo Simon Anfone
 
PPT
programming.ppt
AdrianVANTOPINA
 
PPT
Fundamentals of Programming Chapter 3
Mohd Harris Ahmad Jaal
 
PPT
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
livecoding.tv
 
PPT
3 algorithm-and-flowchart
Rohit Shrivastava
 
PPT
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
Kirti Verma
 
PPT
Lecture_01-Problem_Solving[1]||ProgrammingFundamental.ppt
cosc242101003
 
PPT
Algorithmsandflowcharts1
rajnidhiman
 
PPT
Algorithmsandflowcharts1
ወዲ ህዝቢ
 
PPT
Algorithms and Flowchart.ppt
MsKGowriDhilipkumar
 
PPT
01 Algorithms And Flowcharts.ppt
FerdieBalang
 
PDF
algorithms and flow chart overview.pdf
AmanPratik11
 
PPT
Algorithms and Flowchart for IGCSE Students
MKKhaing
 
PDF
ICP - Lecture 6
Hassaan Rahman
 
PPTX
Algorithmsandflowcharts1
Emmanuel Alimpolos
 
PDF
Introduction to programming : flowchart, algorithm
Kritika Chauhan
 
PPTX
pseudocode Note(IGCSE Computer Sciences)
MKKhaing
 
PPTX
Lec-ProblemSolving.pptx
miansaad18
 
PPT
Programming algorithms and flowchart.ppt
VictorMorcillo1
 
Programming fundamentals lecture 3
Raja Hamid
 
Programming
Leo Simon Anfone
 
programming.ppt
AdrianVANTOPINA
 
Fundamentals of Programming Chapter 3
Mohd Harris Ahmad Jaal
 
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
livecoding.tv
 
3 algorithm-and-flowchart
Rohit Shrivastava
 
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
Kirti Verma
 
Lecture_01-Problem_Solving[1]||ProgrammingFundamental.ppt
cosc242101003
 
Algorithmsandflowcharts1
rajnidhiman
 
Algorithmsandflowcharts1
ወዲ ህዝቢ
 
Algorithms and Flowchart.ppt
MsKGowriDhilipkumar
 
01 Algorithms And Flowcharts.ppt
FerdieBalang
 
algorithms and flow chart overview.pdf
AmanPratik11
 
Algorithms and Flowchart for IGCSE Students
MKKhaing
 
ICP - Lecture 6
Hassaan Rahman
 
Algorithmsandflowcharts1
Emmanuel Alimpolos
 
Introduction to programming : flowchart, algorithm
Kritika Chauhan
 
pseudocode Note(IGCSE Computer Sciences)
MKKhaing
 
Lec-ProblemSolving.pptx
miansaad18
 
Programming algorithms and flowchart.ppt
VictorMorcillo1
 
Ad

More from ALI RAZA (20)

PPTX
Structure
ALI RAZA
 
PPTX
Recursion
ALI RAZA
 
PPTX
Algorithm Development
ALI RAZA
 
PPT
Programming Fundamentals using C++
ALI RAZA
 
PPTX
Introduction to Programming
ALI RAZA
 
PPTX
Introduction to Programming
ALI RAZA
 
PPTX
Array sorting
ALI RAZA
 
PPTX
Array programs
ALI RAZA
 
PPTX
2D-Array
ALI RAZA
 
DOCX
Quiz game documentary
ALI RAZA
 
PPTX
Function pass by value,function pass by reference
ALI RAZA
 
PPTX
Drug Addiction 39 Slides
ALI RAZA
 
PPTX
Drug Addiction Original 51 Slides
ALI RAZA
 
PPTX
Passing stuctures to function
ALI RAZA
 
PDF
Basic general knowledge
ALI RAZA
 
PDF
Dil hua kirchi kirchi by mohammad iqbal shams
ALI RAZA
 
PDF
Pathar kar-do-ankh-mein-ansu-complete
ALI RAZA
 
PDF
Husne akhlaq
ALI RAZA
 
PDF
Parts of speech sticky note definitions and examples
ALI RAZA
 
PDF
Quik tips
ALI RAZA
 
Structure
ALI RAZA
 
Recursion
ALI RAZA
 
Algorithm Development
ALI RAZA
 
Programming Fundamentals using C++
ALI RAZA
 
Introduction to Programming
ALI RAZA
 
Introduction to Programming
ALI RAZA
 
Array sorting
ALI RAZA
 
Array programs
ALI RAZA
 
2D-Array
ALI RAZA
 
Quiz game documentary
ALI RAZA
 
Function pass by value,function pass by reference
ALI RAZA
 
Drug Addiction 39 Slides
ALI RAZA
 
Drug Addiction Original 51 Slides
ALI RAZA
 
Passing stuctures to function
ALI RAZA
 
Basic general knowledge
ALI RAZA
 
Dil hua kirchi kirchi by mohammad iqbal shams
ALI RAZA
 
Pathar kar-do-ankh-mein-ansu-complete
ALI RAZA
 
Husne akhlaq
ALI RAZA
 
Parts of speech sticky note definitions and examples
ALI RAZA
 
Quik tips
ALI RAZA
 
Ad

Recently uploaded (20)

PDF
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPTX
How to Set Maximum Difference Odoo 18 POS
Celine George
 
PDF
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
PPT
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
PDF
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
PDF
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PDF
Dimensions of Societal Planning in Commonism
StefanMz
 
PDF
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
PDF
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
PDF
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
PDF
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PPTX
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
PDF
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
PDF
community health nursing question paper 2.pdf
Prince kumar
 
PPTX
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 
CONCURSO DE POESIA “POETUFAS – PASSOS SUAVES PELO VERSO.pdf
Colégio Santa Teresinha
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
How to Set Maximum Difference Odoo 18 POS
Celine George
 
DIGESTION OF CARBOHYDRATES,PROTEINS,LIPIDS
raviralanaresh2
 
Talk on Critical Theory, Part One, Philosophy of Social Sciences
Soraj Hongladarom
 
SSHS-2025-PKLP_Quarter-1-Dr.-Kerby-Alvarez.pdf
AishahSangcopan1
 
The History of Phone Numbers in Stoke Newington by Billy Thomas
History of Stoke Newington
 
The dynastic history of the Chahmana.pdf
PrachiSontakke5
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Dimensions of Societal Planning in Commonism
StefanMz
 
LAW OF CONTRACT ( 5 YEAR LLB & UNITARY LLB)- MODULE-3 - LEARN THROUGH PICTURE
APARNA T SHAIL KUMAR
 
Isharyanti-2025-Cross Language Communication in Indonesian Language
Neny Isharyanti
 
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
Knee Extensor Mechanism Injuries - Orthopedic Radiologic Imaging
Sean M. Fox
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
I AM MALALA The Girl Who Stood Up for Education and was Shot by the Taliban...
Beena E S
 
Biological Bilingual Glossary Hindi and English Medium
World of Wisdom
 
community health nursing question paper 2.pdf
Prince kumar
 
PATIENT ASSIGNMENTS AND NURSING CARE RESPONSIBILITIES.pptx
PRADEEP ABOTHU
 

pseudocode and Flowchart

  • 2. What is pseudocode?  List of steps written in English  Like the instructions for a recipe  Must be in the right sequence  Imagine saying “bake the cake” and then “mix it up”
  • 3. Sample Pseudocode  Task: add two numbers  Pseudocode:  Start  Get two numbers  Get first number  Get second number  Add them  Print the answer  End
  • 4. Invitation to Computer Science, Java Version, Third Edition 4 Pseudocode  English language constructs modeled to look like statements available in most programming languages  Steps presented in a structured manner (numbered, indented, and so on)  No fixed syntax for most operations is required
  • 5. Invitation to Computer Science, Java Version, Third Edition 5 Pseudocode (continued)  Less ambiguous and more readable than natural language  Emphasis is on process, not notation  Well-understood forms allow logical reasoning about algorithm behavior  Can be easily translated into a programming language
  • 6. Sample Pseudocode  Task: add two numbers  Pseudocode:  Start  Get two numbers  Get first number  Get second number  Add them  Print the answer  End
  • 7. What does a flowchart look like?  The pseudocode from the previous slide would look like this as a flowchart: Start Get 2 numbers Add them Print answer End
  • 8. What are those funny symbols?  START/END  INPUT/OUTPUT  PROCESS  DECISION
  • 9. What are those funny symbols?  START/END  Used at the beginning and end of each flowchart.
  • 10.  INPUT/OUTPUT  Shows when information/data comes into a program or is printed out. What are those funny symbols?
  • 11. What are those funny symbols?  PROCESS  Used to show calculations, storing of data in variables, and other “processes” that take place within a program. What are those funny symbols?
  • 12. What are those funny symbols?  DECISION  Used to show that the program must decide whether something (usually a comparison between numbers) is true or false. YES and NO (or T/F) branches are usually shown. What are those funny symbols? Y N X>7?
  • 13. Another Sample: Calculating Age  Pseudocode:  Start  Get year DOB  Calculate age = (sysdate-DOB)  Print age  If age > 50 print OLD  End
  • 14. Another Sample: Calculating Age  Flowchart  Start  Get year born  Calculate age  Print age  If age > 50 print OLD  End Get yr Calc age Print age Age>50?OLD Y N Start End
  • 15. Self-Check  Look at the flowchart section below. If the variable X is 5, what will print (K or 1st)? X > 5? YN Print “1st”Print “K”
  • 16. Self-Check  Look at the flowchart section below. If the variable X is 5, what will print (K or 1st)? X > 5? YN Print “1st”Print “K” K will be printed. The answer to the question “Is X greater than 5?” is NO, since X is equal to (not greater than) 5.
  • 17. Self-Check  Choose the correct flowchart symbol for each of these statements.  AGE>65?  Calc. Tax  START  Print NAME
  • 18. Self-Check  Choose the correct flowchart symbol for each of these statements.  AGE>65?  Calc. Tax  START  Print NAME
  • 19. Challenge  Try to write pseudocode and create a flowchart for a program that calculates the average of three grades and prints the average.  The word GOOD should be printed only if the average is more than 80.
  • 20. Challenge  Possible pseudocode  Start  Get three grades  Average them (add all of them / number of grads taken)  Print Average  Average>80?  If Yes, print GOOD  End
  • 21. Challenge  Possible flowchart  Start  Get three grades  Average them  Print Average  Average>80?  If Yes, print GOOD  End START END Get 3 grades Calc avg Print avg Avg>80?GOOD Y N
  • 22. Challenge  Try to write pseudocode and create a flowchart for a program that calculates the average of three grades and prints the average.  The word GOOD should be printed only if the average is more than 80.
  • 23. Challenge  Possible pseudocode  Start  Get three grades  Average them  Print Average  Average>80?  If Yes, print GOOD  End
  • 24. Challenge  Possible flowchart  Start  Get three grades  Average them  Print Average  Average>80?  If Yes, print GOOD  End START END Get 3 grades Calc avg Print avg Avg>80?GOOD Y N
  • 26.  Algorithm for Computing Average Miles per Gallon
  • 28.  Write a program to do the task: Print a list of the numbers from 4 to 9, next to each number, print the square of the number.