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

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 cstechzShahbaz Ahmad
 
Lesson 1 - Algorithm and Flowcharting.pdf
Lesson 1 - Algorithm and Flowcharting.pdfLesson 1 - Algorithm and Flowcharting.pdf
Lesson 1 - Algorithm and Flowcharting.pdfROWELL 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 functionsErnesteNtezirizaza
 
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.pdfROWELL MARQUINA
 
Oop lab assignment 01
Oop lab assignment 01Oop lab assignment 01
Oop lab assignment 01Drjilesh
 
Cis355 a ilab 2 control structures and user defined methods devry university
Cis355 a ilab 2 control structures and user defined methods devry universityCis355 a ilab 2 control structures and user defined methods devry university
Cis355 a ilab 2 control structures and user defined methods devry universitysjskjd709707
 
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 6helpido9
 
plc slc 500.pptx
plc slc 500.pptxplc slc 500.pptx
plc slc 500.pptxMUST
 
Cis 355 ilab 4 of 6
Cis 355 ilab 4 of 6Cis 355 ilab 4 of 6
Cis 355 ilab 4 of 6comp274
 
COMP 122 Entire Course NEW
COMP 122 Entire Course NEWCOMP 122 Entire Course NEW
COMP 122 Entire Course NEWshyamuopeight
 
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.pptMuhammadAbdullah311866
 
Iisrt zz mamatha
Iisrt zz mamathaIisrt zz mamatha
Iisrt zz mamathaIISRT
 
Math-Presentation(Math survivor).pptx
Math-Presentation(Math survivor).pptxMath-Presentation(Math survivor).pptx
Math-Presentation(Math survivor).pptxstolenMovie
 
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 codepradesigali1
 

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

negative effects of communication technologies
negative effects of communication technologiesnegative effects of communication technologies
negative effects of communication technologiesgabriela-technoteacher
 
Unit 1. chapter 5. presentation internet
Unit 1. chapter 5. presentation internetUnit 1. chapter 5. presentation internet
Unit 1. chapter 5. presentation internetgabriela-technoteacher
 
Unit 1. chapter 3. presentation satellites
Unit 1. chapter 3. presentation satellitesUnit 1. chapter 3. presentation satellites
Unit 1. chapter 3. presentation satellitesgabriela-technoteacher
 
Portrait: proportions and expressive resources
Portrait: proportions and expressive resourcesPortrait: proportions and expressive resources
Portrait: proportions and expressive resourcesgabriela-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

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdfssuserdda66b
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 

Recently uploaded (20)

Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 

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.