SlideShare a Scribd company logo
1 of 14
UNIT 2_ programming
flow diagrams
exercises
Technologies 1 ESO
gabriela-teacher.blogspot.com
WHAT’S A FLOW DIAGRAM?
A flow diagram is a graphic
representation of a
sequence.
The flow diagram of a program
is the graphic representation
of the sequence of actions
that the computer performs
when we run the program.
This is a very complex example of a flow diagram
EXERCISES
In the next slides, you’ll read a different proposals
of sequences of programs.
You will work cooperatively to work out the flow
diagrams of those sequences. You have to use
the symbols we’ve studied in class
Then, you’ll see the solutions and the teacher will
explain.
This is also useful when you study at home.
PROGRAM 1
When the program starts, the computer asks the
user for two numbers (a and b).
The user enters the two numbers, the computer
adds them up, and shows the user the result…
What’s this program flow
diagram???
START
END
COMPUTER
OUTPUTS
MESSAGE: “Write
two numbers”
USER INPUTS
two numbers
a, b
COMPUTER ADDS
a + b = c
COMPUTER
OUTPUTS : “The
result is c”
PROGRAM 2
This program is a game. When the game starts, the
computer asks the user their age.
If the user is under 18, the computer says “Sorry, you
can’t play” and the game closes.
If the user is over 18, the computer says “Welcome”,
the first level opens and the user plays. After 20
minutes, the game closes automatically.
What’s this program flow diagram???
START
END
COMPUTER
OUTPUTS
MESSAGE: “How
old are you?”
USER INPUTS
age (a)
GAME OPENS
COMPUTER OUTPUTS :
“Sorry, you can’t play”
a > 18 ?
yes
no
COMPUTER
OUTPUTS: “Welcome”
Wait 20 minutes
PROGRAM 3
A program that asks the user for two different
numbers.
When the user enters the two numbers, the
computer compares them and tells the user
which is the highest number.
What’s this program flow
diagram???
START
END
COMPUTER
OUTPUTS
MESSAGE: “Write
two different
numbers”
USER INPUTS
a, b
a > b ?
yes
noCOMPUTER
OUTPUTS: “a is the
biggest number”
COMPUTER
OUTPUTS: “b is the
biggest number”
PROGRAM 4
A program that asks the user for two different
numbers.
When the user enters the two numbers, the
computer first makes sure the numbers are
different.
If they are the same, it asks the user again.
If they are different, it compares them and tells the
user which is the highest number.
What’s this program flow
diagram???
START
END
COMPUTER
OUTPUTS
MESSAGE: “Write
two different
numbers”
USER INPUTS
a, b
a = b ?
yes
no
COMPUTER
OUTPUTS: “a is the
biggest number”
COMPUTER
OUTPUTS: “b is the
biggest number”
a > b ?
yes
no
REAL LIFE SITUATION 1
The sequence of steps when you find out that a
lamp doesn’t work.
What’s this situation flow
diagram???
START:
Lamp
doesn’t
work
END 1:
PROBLE
M
SORTED!

no
yes
no
Is it
plugged
in?
yes
PLUG IN
Is the bulb
burned out?
Does it
work
now?
no
yes
CHANGE
BULB
REPAIR
LAMP
Does it
work
now?
yes
no
Does it
work
now?
yes
END 2:
Buy a new
lamp 
no
EXTRA WORK
If you want to learn more, you can try to design the
flow diagrams of these programs:
PROGRAM 5  An app that ask the user for a password. The app checks if the password is correct. If
not, ask the user to re-write it. If it’s correct, the app opens. The maximum number of tries the
user has is 3. After 3 failures, the app closes saying “Sorry, try again later”.
REAL LIFE SITUATION 2  Your home is at walking distance from school, but you prefer to wait for the
bus. When you arrive to the bus station, you only take the bus if it’s right there or if it’s
approaching the bus stop. If you can’t see the bus, you walk to school.
PROGRAM 6  A program that asks the user for a number. If the number is higher than 10, the
program divides the number per 10 and shows the result. If the number is lower, the computer
says “Sorry, you number must be higher than 10” and ask the user for a number again.
REAL LIFE SITUATION 3  The sequence of actions you perform in a normal school afternoon between
6 pm and 9 pm.

More Related Content

Similar to Presentation flow diagrams exercises

Lesson 1 - Algorithm and Flowcharting.pdf
Lesson 1 - Algorithm and Flowcharting.pdfLesson 1 - Algorithm and Flowcharting.pdf
Lesson 1 - Algorithm and Flowcharting.pdf
ROWELL MARQUINA
 
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
ErnesteNtezirizaza
 
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
sjskjd709707
 
Cis 355 i lab 4 of 6
Cis 355 i lab 4 of 6Cis 355 i lab 4 of 6
Cis 355 i lab 4 of 6
helpido9
 
Cis 355 ilab 4 of 6
Cis 355 ilab 4 of 6Cis 355 ilab 4 of 6
Cis 355 ilab 4 of 6
comp274
 
Iisrt zz mamatha
Iisrt zz mamathaIisrt zz mamatha
Iisrt zz mamatha
IISRT
 

Similar to Presentation flow diagrams exercises (20)

10th class computer science notes in english by cstechz
10th class computer science notes in english by cstechz10th class computer science notes in english by cstechz
10th class computer science notes in english by cstechz
 
Lesson 1 - Algorithm and Flowcharting.pdf
Lesson 1 - Algorithm and Flowcharting.pdfLesson 1 - Algorithm and Flowcharting.pdf
Lesson 1 - Algorithm and Flowcharting.pdf
 
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
 
DSA Lesson 2 - Algorithm and Flowcharting.pdf
DSA Lesson 2 - Algorithm and Flowcharting.pdfDSA Lesson 2 - Algorithm and Flowcharting.pdf
DSA Lesson 2 - Algorithm and Flowcharting.pdf
 
Function ppt
Function pptFunction ppt
Function ppt
 
Introduction.pptx
Introduction.pptxIntroduction.pptx
Introduction.pptx
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01
 
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
 
Cis 355 i lab 4 of 6
Cis 355 i lab 4 of 6Cis 355 i lab 4 of 6
Cis 355 i lab 4 of 6
 
plc slc 500.pptx
plc slc 500.pptxplc slc 500.pptx
plc slc 500.pptx
 
17 Jo P May 08
17 Jo P May 0817 Jo P May 08
17 Jo P May 08
 
Cis 355 ilab 4 of 6
Cis 355 ilab 4 of 6Cis 355 ilab 4 of 6
Cis 355 ilab 4 of 6
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEW
 
compatibility and complexity in the IS.ppt
compatibility and complexity in the IS.pptcompatibility and complexity in the IS.ppt
compatibility and complexity in the IS.ppt
 
Python in details
Python in detailsPython in details
Python in details
 
Programming part2
Programming part2Programming part2
Programming part2
 
Iisrt zz mamatha
Iisrt zz mamathaIisrt zz mamatha
Iisrt zz mamatha
 
Math-Presentation(Math survivor).pptx
Math-Presentation(Math survivor).pptxMath-Presentation(Math survivor).pptx
Math-Presentation(Math survivor).pptx
 
Notacd08
Notacd08Notacd08
Notacd08
 
Comp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source codeComp 122 lab 2 lab report and source code
Comp 122 lab 2 lab report and source code
 

More from gabriela-technoteacher

More from gabriela-technoteacher (20)

Workshop rules and roles
Workshop rules and rolesWorkshop rules and roles
Workshop rules and roles
 
Structures
StructuresStructures
Structures
 
Comic language
Comic languageComic language
Comic language
 
Camera shots and angles
Camera shots and anglesCamera shots and angles
Camera shots and angles
 
Unit 1. chapter 4.
Unit 1. chapter 4. Unit 1. chapter 4.
Unit 1. chapter 4.
 
My expressionist school
My expressionist schoolMy expressionist school
My expressionist school
 
Structures presentation improved
Structures presentation improvedStructures presentation improved
Structures presentation improved
 
negative effects of communication technologies
negative effects of communication technologiesnegative effects of communication technologies
negative effects of communication technologies
 
presentation television
presentation televisionpresentation television
presentation television
 
Unit 1. chapter 5. presentation internet
Unit 1. chapter 5. presentation internetUnit 1. chapter 5. presentation internet
Unit 1. chapter 5. presentation internet
 
Unit 1. chapter 3. presentation satellites
Unit 1. chapter 3. presentation satellitesUnit 1. chapter 3. presentation satellites
Unit 1. chapter 3. presentation satellites
 
Unit 1. chapter 2. presentation radio
Unit 1. chapter 2. presentation radioUnit 1. chapter 2. presentation radio
Unit 1. chapter 2. presentation radio
 
mobile phones
mobile phonesmobile phones
mobile phones
 
Ejemplos anuncios
Ejemplos anunciosEjemplos anuncios
Ejemplos anuncios
 
Structures presentation for 3rd ESO
Structures presentation for 3rd ESOStructures presentation for 3rd ESO
Structures presentation for 3rd ESO
 
Classical orders
Classical ordersClassical orders
Classical orders
 
Movie crew presentation
Movie crew presentationMovie crew presentation
Movie crew presentation
 
Byzantine mosaics
Byzantine mosaics Byzantine mosaics
Byzantine mosaics
 
Connecting brains to machines
Connecting brains to machinesConnecting brains to machines
Connecting brains to machines
 
Portrait: proportions and expressive resources
Portrait: proportions and expressive resourcesPortrait: proportions and expressive resources
Portrait: proportions and expressive resources
 

Recently uploaded

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Recently uploaded (20)

Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 

Presentation flow diagrams exercises

  • 1. UNIT 2_ programming flow diagrams exercises Technologies 1 ESO gabriela-teacher.blogspot.com
  • 2. WHAT’S A FLOW DIAGRAM? A flow diagram is a graphic representation of a sequence. The flow diagram of a program is the graphic representation of the sequence of actions that the computer performs when we run the program. This is a very complex example of a flow diagram
  • 3. EXERCISES In the next slides, you’ll read a different proposals of sequences of programs. You will work cooperatively to work out the flow diagrams of those sequences. You have to use the symbols we’ve studied in class Then, you’ll see the solutions and the teacher will explain. This is also useful when you study at home.
  • 4. PROGRAM 1 When the program starts, the computer asks the user for two numbers (a and b). The user enters the two numbers, the computer adds them up, and shows the user the result… What’s this program flow diagram???
  • 5. START END COMPUTER OUTPUTS MESSAGE: “Write two numbers” USER INPUTS two numbers a, b COMPUTER ADDS a + b = c COMPUTER OUTPUTS : “The result is c”
  • 6. PROGRAM 2 This program is a game. When the game starts, the computer asks the user their age. If the user is under 18, the computer says “Sorry, you can’t play” and the game closes. If the user is over 18, the computer says “Welcome”, the first level opens and the user plays. After 20 minutes, the game closes automatically. What’s this program flow diagram???
  • 7. START END COMPUTER OUTPUTS MESSAGE: “How old are you?” USER INPUTS age (a) GAME OPENS COMPUTER OUTPUTS : “Sorry, you can’t play” a > 18 ? yes no COMPUTER OUTPUTS: “Welcome” Wait 20 minutes
  • 8. PROGRAM 3 A program that asks the user for two different numbers. When the user enters the two numbers, the computer compares them and tells the user which is the highest number. What’s this program flow diagram???
  • 9. START END COMPUTER OUTPUTS MESSAGE: “Write two different numbers” USER INPUTS a, b a > b ? yes noCOMPUTER OUTPUTS: “a is the biggest number” COMPUTER OUTPUTS: “b is the biggest number”
  • 10. PROGRAM 4 A program that asks the user for two different numbers. When the user enters the two numbers, the computer first makes sure the numbers are different. If they are the same, it asks the user again. If they are different, it compares them and tells the user which is the highest number. What’s this program flow diagram???
  • 11. START END COMPUTER OUTPUTS MESSAGE: “Write two different numbers” USER INPUTS a, b a = b ? yes no COMPUTER OUTPUTS: “a is the biggest number” COMPUTER OUTPUTS: “b is the biggest number” a > b ? yes no
  • 12. REAL LIFE SITUATION 1 The sequence of steps when you find out that a lamp doesn’t work. What’s this situation flow diagram???
  • 13. START: Lamp doesn’t work END 1: PROBLE M SORTED!  no yes no Is it plugged in? yes PLUG IN Is the bulb burned out? Does it work now? no yes CHANGE BULB REPAIR LAMP Does it work now? yes no Does it work now? yes END 2: Buy a new lamp  no
  • 14. EXTRA WORK If you want to learn more, you can try to design the flow diagrams of these programs: PROGRAM 5  An app that ask the user for a password. The app checks if the password is correct. If not, ask the user to re-write it. If it’s correct, the app opens. The maximum number of tries the user has is 3. After 3 failures, the app closes saying “Sorry, try again later”. REAL LIFE SITUATION 2  Your home is at walking distance from school, but you prefer to wait for the bus. When you arrive to the bus station, you only take the bus if it’s right there or if it’s approaching the bus stop. If you can’t see the bus, you walk to school. PROGRAM 6  A program that asks the user for a number. If the number is higher than 10, the program divides the number per 10 and shows the result. If the number is lower, the computer says “Sorry, you number must be higher than 10” and ask the user for a number again. REAL LIFE SITUATION 3  The sequence of actions you perform in a normal school afternoon between 6 pm and 9 pm.