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

PDF
Pseudocode & flowchart examples
PPTX
Pseudocode
PPT
pseudo code basics
PPTX
Algorithm and pseudo codes
PPTX
Algorithm and flowchart
PPTX
Programming process and flowchart
PPTX
Flowchart and algorithm
PDF
Pseudocode By ZAK
Pseudocode & flowchart examples
Pseudocode
pseudo code basics
Algorithm and pseudo codes
Algorithm and flowchart
Programming process and flowchart
Flowchart and algorithm
Pseudocode By ZAK

What's hot (20)

PPTX
Introduction to programming
PDF
SPL 2 | Algorithms, Pseudo-code, and Flowchart
PDF
Flowchart pseudocode-examples
PPTX
Programming Fundamentals
PPSX
Programming Fundamental Presentation
PPTX
Pseudocode-Flowchart
PPT
Chapter 1 - An Introduction to Programming
PPTX
Algorithms and Flowcharts
PPTX
Pseudocode flowcharts
PPTX
Pseudocode
PPTX
Variables in C++, data types in c++
PPT
Intro To Programming Concepts
PPT
Introduction to Algorithms & flow charts
PPSX
Algorithm and flowchart
PPT
PDF
Computer Programming
PPT
1. over view and history of c
PPT
3 algorithm-and-flowchart
PPT
Lect 1. introduction to programming languages
PPTX
Programming Fundamentals lecture 1
Introduction to programming
SPL 2 | Algorithms, Pseudo-code, and Flowchart
Flowchart pseudocode-examples
Programming Fundamentals
Programming Fundamental Presentation
Pseudocode-Flowchart
Chapter 1 - An Introduction to Programming
Algorithms and Flowcharts
Pseudocode flowcharts
Pseudocode
Variables in C++, data types in c++
Intro To Programming Concepts
Introduction to Algorithms & flow charts
Algorithm and flowchart
Computer Programming
1. over view and history of c
3 algorithm-and-flowchart
Lect 1. introduction to programming languages
Programming Fundamentals lecture 1
Ad

Similar to pseudocode and Flowchart (20)

PPTX
Programming fundamentals lecture 3
PPT
Programming
PPT
programming.ppt
PPT
Fundamentals of Programming Chapter 3
PPT
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
PPT
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
PPT
Lecture_01-Problem_Solving[1]||ProgrammingFundamental.ppt
PPT
Algorithmsandflowcharts1
PPT
Algorithmsandflowcharts1
PPT
Algorithms and Flowchart.ppt
PPT
01 Algorithms And Flowcharts.ppt
PDF
algorithms and flow chart overview.pdf
PPT
Algorithms and Flowchart for IGCSE Students
PDF
ICP - Lecture 6
PPTX
Algorithmsandflowcharts1
PPTX
INTROTOPROBLEMSOLVING.pptxINTROTOPROBLEMSOLVING.pptx
PDF
Introduction to programming : flowchart, algorithm
PPTX
pseudocode Note(IGCSE Computer Sciences)
PPTX
Lec-ProblemSolving.pptx
PPT
Programming algorithms and flowchart.ppt
Programming fundamentals lecture 3
Programming
programming.ppt
Fundamentals of Programming Chapter 3
Learn Programming with Livecoding.tv http://goo.gl/tIgO1I
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
Lecture_01-Problem_Solving[1]||ProgrammingFundamental.ppt
Algorithmsandflowcharts1
Algorithmsandflowcharts1
Algorithms and Flowchart.ppt
01 Algorithms And Flowcharts.ppt
algorithms and flow chart overview.pdf
Algorithms and Flowchart for IGCSE Students
ICP - Lecture 6
Algorithmsandflowcharts1
INTROTOPROBLEMSOLVING.pptxINTROTOPROBLEMSOLVING.pptx
Introduction to programming : flowchart, algorithm
pseudocode Note(IGCSE Computer Sciences)
Lec-ProblemSolving.pptx
Programming algorithms and flowchart.ppt
Ad

More from ALI RAZA (20)

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

Recently uploaded (20)

PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Cell Structure & Organelles in detailed.
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Classroom Observation Tools for Teachers
PDF
Pre independence Education in Inndia.pdf
PPTX
Pharma ospi slides which help in ospi learning
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Complications of Minimal Access Surgery at WLH
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Lesson notes of climatology university.
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
01-Introduction-to-Information-Management.pdf
Supply Chain Operations Speaking Notes -ICLT Program
Microbial disease of the cardiovascular and lymphatic systems
Cell Structure & Organelles in detailed.
2.FourierTransform-ShortQuestionswithAnswers.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Microbial diseases, their pathogenesis and prophylaxis
Abdominal Access Techniques with Prof. Dr. R K Mishra
Classroom Observation Tools for Teachers
Pre independence Education in Inndia.pdf
Pharma ospi slides which help in ospi learning
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Complications of Minimal Access Surgery at WLH
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
GDM (1) (1).pptx small presentation for students
Lesson notes of climatology university.
Module 4: Burden of Disease Tutorial Slides S2 2025
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
01-Introduction-to-Information-Management.pdf

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.