SlideShare a Scribd company logo
1 of 13
L.O: SWBAT INTRODUCTION
TO FLOW CHARTS.
Sequences:
The most basic algorithm uses sequences
to present a list of instructions to be
followed one after the other, step by step.
An algorithm is a plan, a set of step-by-step instructions that a
computer follows to solve a problem.
To solve the problem, the instructions have to be followed in the right
order.
If the instructions are not carried out in the right order, you won’t get
the result you expected!
1.Start
2.unlock the door
3.open the door
4.enter the room
5.switch on the light
6.close the door behind you
7.stop
Selection:
1. IF the door is locked, THEN
unlock the door, ELSE do
nothing (go to next instruction)
2. IF the door is closed, THEN
open the door, ELSE do nothing
3. Enter the room
4. IF the room is dark, THEN
switch on the light, ELSE do
nothing
5. Close the door behind you
A selection is used to make choices based on information.
An algorithm can be made more intelligent by using IF, THEN
and ELSE to repeat instructions or move to different parts of
the program.
Iteration
• Iteration is the process of looping or repeating
sections of a program.
• There are two types of iteration: count-controlled
and condition-controlled.
• Count-controlled loops repeat the same steps a
specific number of times,
• regardless of the outcome.
• But a condition-controlled loop will keep repeating
the steps over and over…and over…and over…and
over, until it gets a specific result.
For loop (Count-controlled loop)
• The count-controlled loop can be described as a
FOR loop. The program repeats the action FOR a
number of times.
Here is an example using pseudocode:
Make “count” = 0
For as long as “count” is in the range of 0 to 5
Print “I am in loop number: ” and the value
contained in “count” together on a line
Increment “count” by 1
Condition-controlled loops
A program could be made more intelligent by
programming it to avoid hazards. For
example, if the robot vehicle is 3 cm from the
edge of the table and you tell it to move
forwards 5 cm, it will drive off the edge of the
table. To stop this from happening, you might
write a condition-controlled loop like this:
move forward
repeat until (touching table edge)
WHILE loops
Condition-controlled loops are also called WHILE
loops or WHILE-ENDWHILE statements. A WHILE
loop code is repeated based on a certain
condition. The condition could be 'true' or 'false'.
The WHILE loop executes while a condition is
true. Whether the condition is met or not is
checked at the beginning of the loop. If the
condition is 'true' it repeats, if not then the code
is not executed.
For example, to stop the robot from driving off
the edge of a table, you might write a WHILE loop
like this:
Move forward WHILE I am not
touching the table edge
DO WHILE loops
A similar condition-controlled loop is a DO
WHILE loop. This method differs from a
WHILE condition-controlled loop in that the
condition is checked at the end of the loop. If
the condition is ‘true’, the loop repeats.
Thus, the code in the loop is executed at
least once.
count = 1
do
print(count)
count+=1
while count <4
REPEAT UNTIL loops
REPEAT UNTIL loops are condition-controlled
loops that are found in older languages such as
BASIC or PASCAL. The principal is the same as a
DO WHILE loop, in that the condition is checked
at the end of the loop, thus the behaviour is the
same. Consider this pseudo-code example:
count = 1
repeat
print(count)
count+=1
until count >3
Infinite loops
Condition-controlled loops can result in
intentional or unintentional infinite loops. If we
wanted to loop indefinitely, we could set a
condition that would never be met, thus iterating
infinitely. The following examples would result in
an infinite loop:
Infinite loops
WHILE:
count = 1
while count <>0:
print(count)
count +=1
Infinite loops
DO WHILE:
count = 1
do
print(count)
count+=1
while count <>0
Infinite loops
REPEAT UNTIL:
count = 1
repeat
print(count)
count+=1
until count =0

More Related Content

What's hot

The probability that three men hit a target are respectively 1.docx
The probability that  three men hit a target are respectively 1.docxThe probability that  three men hit a target are respectively 1.docx
The probability that three men hit a target are respectively 1.docxNadeem Uddin
 
Learning theories and Serious Games
Learning theories and Serious GamesLearning theories and Serious Games
Learning theories and Serious Gameshelenaxe
 
11.2 experimental probability
11.2 experimental probability11.2 experimental probability
11.2 experimental probabilityJoanne Catlett
 
Angle of Attack | Q & A | Question Analysis | Flight Mechanics | GATE Aerospace
Angle of Attack | Q & A | Question Analysis | Flight Mechanics | GATE AerospaceAngle of Attack | Q & A | Question Analysis | Flight Mechanics | GATE Aerospace
Angle of Attack | Q & A | Question Analysis | Flight Mechanics | GATE AerospaceAge of Aerospace
 
TEENAGE PREGNANCY PREVENTION: A COLLABORATIVE APPROACH
TEENAGE PREGNANCY PREVENTION: A COLLABORATIVE APPROACH TEENAGE PREGNANCY PREVENTION: A COLLABORATIVE APPROACH
TEENAGE PREGNANCY PREVENTION: A COLLABORATIVE APPROACH Rommel Luis III Israel
 
Maapuolustuksen uusi taistelutapa ja johtaminen
Maapuolustuksen uusi taistelutapa ja johtaminenMaapuolustuksen uusi taistelutapa ja johtaminen
Maapuolustuksen uusi taistelutapa ja johtaminenJuha Mattila
 
Aircraft Performance: Part I
Aircraft Performance: Part IAircraft Performance: Part I
Aircraft Performance: Part IMohammad Tawfik
 
Common monomial factor Motivation (4PICS 1 WORD)
Common monomial factor Motivation (4PICS 1 WORD)Common monomial factor Motivation (4PICS 1 WORD)
Common monomial factor Motivation (4PICS 1 WORD)Lorie Jane Letada
 
Table tennis lesson
Table tennis lesson Table tennis lesson
Table tennis lesson JO GALLEGOS
 
Superficies y mandos de control de un avion
Superficies y mandos de control de un avionSuperficies y mandos de control de un avion
Superficies y mandos de control de un avionJorge Coronel
 
Basics on airfoils and lift generation
Basics on airfoils and lift generationBasics on airfoils and lift generation
Basics on airfoils and lift generationmayawwo
 
Hands on experience with various type of tabs
Hands on experience with various type of tabsHands on experience with various type of tabs
Hands on experience with various type of tabsMayank Gupta
 
12. Angle of Elevation & Depression.pptx
12. Angle of Elevation & Depression.pptx12. Angle of Elevation & Depression.pptx
12. Angle of Elevation & Depression.pptxBebeannBuar1
 
Numerical Methods for Engineers 7th Edition Chapra Solutions Manual
Numerical Methods for Engineers 7th Edition Chapra Solutions ManualNumerical Methods for Engineers 7th Edition Chapra Solutions Manual
Numerical Methods for Engineers 7th Edition Chapra Solutions ManualForemanForemans
 

What's hot (20)

The probability that three men hit a target are respectively 1.docx
The probability that  three men hit a target are respectively 1.docxThe probability that  three men hit a target are respectively 1.docx
The probability that three men hit a target are respectively 1.docx
 
Learning theories and Serious Games
Learning theories and Serious GamesLearning theories and Serious Games
Learning theories and Serious Games
 
PHYSICAL FITNESS TEST SCORE CARD
PHYSICAL FITNESS TEST SCORE CARDPHYSICAL FITNESS TEST SCORE CARD
PHYSICAL FITNESS TEST SCORE CARD
 
11.2 experimental probability
11.2 experimental probability11.2 experimental probability
11.2 experimental probability
 
Landings
LandingsLandings
Landings
 
Angle of Attack | Q & A | Question Analysis | Flight Mechanics | GATE Aerospace
Angle of Attack | Q & A | Question Analysis | Flight Mechanics | GATE AerospaceAngle of Attack | Q & A | Question Analysis | Flight Mechanics | GATE Aerospace
Angle of Attack | Q & A | Question Analysis | Flight Mechanics | GATE Aerospace
 
TEENAGE PREGNANCY PREVENTION: A COLLABORATIVE APPROACH
TEENAGE PREGNANCY PREVENTION: A COLLABORATIVE APPROACH TEENAGE PREGNANCY PREVENTION: A COLLABORATIVE APPROACH
TEENAGE PREGNANCY PREVENTION: A COLLABORATIVE APPROACH
 
Maapuolustuksen uusi taistelutapa ja johtaminen
Maapuolustuksen uusi taistelutapa ja johtaminenMaapuolustuksen uusi taistelutapa ja johtaminen
Maapuolustuksen uusi taistelutapa ja johtaminen
 
Module 6 updated
Module 6 updatedModule 6 updated
Module 6 updated
 
4th quarter-math-10
4th quarter-math-104th quarter-math-10
4th quarter-math-10
 
Aircraft Performance: Part I
Aircraft Performance: Part IAircraft Performance: Part I
Aircraft Performance: Part I
 
Common monomial factor Motivation (4PICS 1 WORD)
Common monomial factor Motivation (4PICS 1 WORD)Common monomial factor Motivation (4PICS 1 WORD)
Common monomial factor Motivation (4PICS 1 WORD)
 
GEOMETRY: POINTS, LINES. PLANES
GEOMETRY: POINTS, LINES. PLANESGEOMETRY: POINTS, LINES. PLANES
GEOMETRY: POINTS, LINES. PLANES
 
Table tennis lesson
Table tennis lesson Table tennis lesson
Table tennis lesson
 
Superficies y mandos de control de un avion
Superficies y mandos de control de un avionSuperficies y mandos de control de un avion
Superficies y mandos de control de un avion
 
Basics on airfoils and lift generation
Basics on airfoils and lift generationBasics on airfoils and lift generation
Basics on airfoils and lift generation
 
Hands on experience with various type of tabs
Hands on experience with various type of tabsHands on experience with various type of tabs
Hands on experience with various type of tabs
 
12. Angle of Elevation & Depression.pptx
12. Angle of Elevation & Depression.pptx12. Angle of Elevation & Depression.pptx
12. Angle of Elevation & Depression.pptx
 
Numerical Methods for Engineers 7th Edition Chapra Solutions Manual
Numerical Methods for Engineers 7th Edition Chapra Solutions ManualNumerical Methods for Engineers 7th Edition Chapra Solutions Manual
Numerical Methods for Engineers 7th Edition Chapra Solutions Manual
 
The Law of Cosines demo
The Law of Cosines demoThe Law of Cosines demo
The Law of Cosines demo
 

Similar to Lesson flow charts 1 (20)

ACM init() Day 3
ACM init() Day 3ACM init() Day 3
ACM init() Day 3
 
Loops
LoopsLoops
Loops
 
loops and iteration.docx
loops and iteration.docxloops and iteration.docx
loops and iteration.docx
 
Init() Lesson 3
Init() Lesson 3Init() Lesson 3
Init() Lesson 3
 
While loop
While loopWhile loop
While loop
 
Notes2
Notes2Notes2
Notes2
 
Loop and while Loop
Loop and while LoopLoop and while Loop
Loop and while Loop
 
Going loopy - Introduction to Loops.pptx
Going loopy - Introduction to Loops.pptxGoing loopy - Introduction to Loops.pptx
Going loopy - Introduction to Loops.pptx
 
Writing algorithms
Writing algorithmsWriting algorithms
Writing algorithms
 
Introduction to loops cpu
Introduction to loops  cpuIntroduction to loops  cpu
Introduction to loops cpu
 
Loops c++
Loops c++Loops c++
Loops c++
 
Fundamentals of Programming Chapter 7
Fundamentals of Programming Chapter 7Fundamentals of Programming Chapter 7
Fundamentals of Programming Chapter 7
 
CMIS 102 Hands-On Lab Week 4OverviewThis hands-on lab all.docx
CMIS 102 Hands-On Lab Week 4OverviewThis hands-on lab all.docxCMIS 102 Hands-On Lab Week 4OverviewThis hands-on lab all.docx
CMIS 102 Hands-On Lab Week 4OverviewThis hands-on lab all.docx
 
Python Flow Control
Python Flow ControlPython Flow Control
Python Flow Control
 
Loops in Python.pptx
Loops in Python.pptxLoops in Python.pptx
Loops in Python.pptx
 
While-For-loop in python used in college
While-For-loop in python used in collegeWhile-For-loop in python used in college
While-For-loop in python used in college
 
Small Basic - Branching and Loop
Small Basic - Branching and LoopSmall Basic - Branching and Loop
Small Basic - Branching and Loop
 
Algorithm Designs - Control Structures
Algorithm Designs - Control StructuresAlgorithm Designs - Control Structures
Algorithm Designs - Control Structures
 
Programming loop
Programming loopProgramming loop
Programming loop
 
1660213363910.pdf
1660213363910.pdf1660213363910.pdf
1660213363910.pdf
 

More from Lexume1

Lesson flow charts 2
Lesson flow charts 2Lesson flow charts 2
Lesson flow charts 2Lexume1
 
Ap exam big idea 7 global impact
Ap exam big idea 7 global impactAp exam big idea 7 global impact
Ap exam big idea 7 global impactLexume1
 
Lesson pseudocode
Lesson  pseudocodeLesson  pseudocode
Lesson pseudocodeLexume1
 
Ap exam big idea 6 the internet
Ap exam big idea 6 the internetAp exam big idea 6 the internet
Ap exam big idea 6 the internetLexume1
 
Ap exam big idea 5 programming
Ap exam big idea 5 programmingAp exam big idea 5 programming
Ap exam big idea 5 programmingLexume1
 
Ap exam big idea 4 algorithms
Ap exam big idea 4 algorithmsAp exam big idea 4 algorithms
Ap exam big idea 4 algorithmsLexume1
 
Ap exam big idea 3 data and information
Ap exam big idea 3 data and informationAp exam big idea 3 data and information
Ap exam big idea 3 data and informationLexume1
 
Ap exam big idea 2 abstraction
Ap exam big idea 2 abstractionAp exam big idea 2 abstraction
Ap exam big idea 2 abstractionLexume1
 
Lesson4.4 u4 l1 using hex
Lesson4.4 u4 l1 using hexLesson4.4 u4 l1 using hex
Lesson4.4 u4 l1 using hexLexume1
 
Lesson4.3 u4 l1 hexadecimal representation
Lesson4.3 u4 l1 hexadecimal representationLesson4.3 u4 l1 hexadecimal representation
Lesson4.3 u4 l1 hexadecimal representationLexume1
 
Lesson4.2 u4 l1 binary squences
Lesson4.2 u4 l1 binary squencesLesson4.2 u4 l1 binary squences
Lesson4.2 u4 l1 binary squencesLexume1
 
Lesson4.1 u4 l1 binary representation
Lesson4.1 u4 l1 binary representationLesson4.1 u4 l1 binary representation
Lesson4.1 u4 l1 binary representationLexume1
 
Lesson4.0 unit 4 the internet and global impact
Lesson4.0 unit 4  the internet and global impactLesson4.0 unit 4  the internet and global impact
Lesson4.0 unit 4 the internet and global impactLexume1
 
Lesson4.9 d u4l3 hierarchy of open protocols
Lesson4.9 d u4l3 hierarchy of open protocolsLesson4.9 d u4l3 hierarchy of open protocols
Lesson4.9 d u4l3 hierarchy of open protocolsLexume1
 
Lesson4.9 c u4l3 tcp (transmission control protocol)
Lesson4.9 c u4l3 tcp (transmission control protocol)Lesson4.9 c u4l3 tcp (transmission control protocol)
Lesson4.9 c u4l3 tcp (transmission control protocol)Lexume1
 
Lesson4.9 b u4l3 ip addresses
Lesson4.9 b u4l3 ip addressesLesson4.9 b u4l3 ip addresses
Lesson4.9 b u4l3 ip addressesLexume1
 
Lesson4.9 a u4l2 html
Lesson4.9 a u4l2 htmlLesson4.9 a u4l2 html
Lesson4.9 a u4l2 htmlLexume1
 
Lesson4.8 u4 l2 address hierarchy
Lesson4.8 u4 l2 address hierarchyLesson4.8 u4 l2 address hierarchy
Lesson4.8 u4 l2 address hierarchyLexume1
 
Lesson4.7 u4 l2 network redundancy
Lesson4.7 u4 l2 network redundancyLesson4.7 u4 l2 network redundancy
Lesson4.7 u4 l2 network redundancyLexume1
 
Lesson4.6 u4 l2 what is the internet?
Lesson4.6 u4 l2 what is the internet?Lesson4.6 u4 l2 what is the internet?
Lesson4.6 u4 l2 what is the internet?Lexume1
 

More from Lexume1 (20)

Lesson flow charts 2
Lesson flow charts 2Lesson flow charts 2
Lesson flow charts 2
 
Ap exam big idea 7 global impact
Ap exam big idea 7 global impactAp exam big idea 7 global impact
Ap exam big idea 7 global impact
 
Lesson pseudocode
Lesson  pseudocodeLesson  pseudocode
Lesson pseudocode
 
Ap exam big idea 6 the internet
Ap exam big idea 6 the internetAp exam big idea 6 the internet
Ap exam big idea 6 the internet
 
Ap exam big idea 5 programming
Ap exam big idea 5 programmingAp exam big idea 5 programming
Ap exam big idea 5 programming
 
Ap exam big idea 4 algorithms
Ap exam big idea 4 algorithmsAp exam big idea 4 algorithms
Ap exam big idea 4 algorithms
 
Ap exam big idea 3 data and information
Ap exam big idea 3 data and informationAp exam big idea 3 data and information
Ap exam big idea 3 data and information
 
Ap exam big idea 2 abstraction
Ap exam big idea 2 abstractionAp exam big idea 2 abstraction
Ap exam big idea 2 abstraction
 
Lesson4.4 u4 l1 using hex
Lesson4.4 u4 l1 using hexLesson4.4 u4 l1 using hex
Lesson4.4 u4 l1 using hex
 
Lesson4.3 u4 l1 hexadecimal representation
Lesson4.3 u4 l1 hexadecimal representationLesson4.3 u4 l1 hexadecimal representation
Lesson4.3 u4 l1 hexadecimal representation
 
Lesson4.2 u4 l1 binary squences
Lesson4.2 u4 l1 binary squencesLesson4.2 u4 l1 binary squences
Lesson4.2 u4 l1 binary squences
 
Lesson4.1 u4 l1 binary representation
Lesson4.1 u4 l1 binary representationLesson4.1 u4 l1 binary representation
Lesson4.1 u4 l1 binary representation
 
Lesson4.0 unit 4 the internet and global impact
Lesson4.0 unit 4  the internet and global impactLesson4.0 unit 4  the internet and global impact
Lesson4.0 unit 4 the internet and global impact
 
Lesson4.9 d u4l3 hierarchy of open protocols
Lesson4.9 d u4l3 hierarchy of open protocolsLesson4.9 d u4l3 hierarchy of open protocols
Lesson4.9 d u4l3 hierarchy of open protocols
 
Lesson4.9 c u4l3 tcp (transmission control protocol)
Lesson4.9 c u4l3 tcp (transmission control protocol)Lesson4.9 c u4l3 tcp (transmission control protocol)
Lesson4.9 c u4l3 tcp (transmission control protocol)
 
Lesson4.9 b u4l3 ip addresses
Lesson4.9 b u4l3 ip addressesLesson4.9 b u4l3 ip addresses
Lesson4.9 b u4l3 ip addresses
 
Lesson4.9 a u4l2 html
Lesson4.9 a u4l2 htmlLesson4.9 a u4l2 html
Lesson4.9 a u4l2 html
 
Lesson4.8 u4 l2 address hierarchy
Lesson4.8 u4 l2 address hierarchyLesson4.8 u4 l2 address hierarchy
Lesson4.8 u4 l2 address hierarchy
 
Lesson4.7 u4 l2 network redundancy
Lesson4.7 u4 l2 network redundancyLesson4.7 u4 l2 network redundancy
Lesson4.7 u4 l2 network redundancy
 
Lesson4.6 u4 l2 what is the internet?
Lesson4.6 u4 l2 what is the internet?Lesson4.6 u4 l2 what is the internet?
Lesson4.6 u4 l2 what is the internet?
 

Recently uploaded

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.arsicmarija21
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationAadityaSharma884161
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 

Recently uploaded (20)

DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.AmericanHighSchoolsprezentacijaoskolama.
AmericanHighSchoolsprezentacijaoskolama.
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
ROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint PresentationROOT CAUSE ANALYSIS PowerPoint Presentation
ROOT CAUSE ANALYSIS PowerPoint Presentation
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"Rapple "Scholarly Communications and the Sustainable Development Goals"
Rapple "Scholarly Communications and the Sustainable Development Goals"
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

Lesson flow charts 1

  • 2. Sequences: The most basic algorithm uses sequences to present a list of instructions to be followed one after the other, step by step. An algorithm is a plan, a set of step-by-step instructions that a computer follows to solve a problem. To solve the problem, the instructions have to be followed in the right order. If the instructions are not carried out in the right order, you won’t get the result you expected! 1.Start 2.unlock the door 3.open the door 4.enter the room 5.switch on the light 6.close the door behind you 7.stop
  • 3. Selection: 1. IF the door is locked, THEN unlock the door, ELSE do nothing (go to next instruction) 2. IF the door is closed, THEN open the door, ELSE do nothing 3. Enter the room 4. IF the room is dark, THEN switch on the light, ELSE do nothing 5. Close the door behind you A selection is used to make choices based on information. An algorithm can be made more intelligent by using IF, THEN and ELSE to repeat instructions or move to different parts of the program.
  • 4. Iteration • Iteration is the process of looping or repeating sections of a program. • There are two types of iteration: count-controlled and condition-controlled. • Count-controlled loops repeat the same steps a specific number of times, • regardless of the outcome. • But a condition-controlled loop will keep repeating the steps over and over…and over…and over…and over, until it gets a specific result.
  • 5. For loop (Count-controlled loop) • The count-controlled loop can be described as a FOR loop. The program repeats the action FOR a number of times. Here is an example using pseudocode: Make “count” = 0 For as long as “count” is in the range of 0 to 5 Print “I am in loop number: ” and the value contained in “count” together on a line Increment “count” by 1
  • 6. Condition-controlled loops A program could be made more intelligent by programming it to avoid hazards. For example, if the robot vehicle is 3 cm from the edge of the table and you tell it to move forwards 5 cm, it will drive off the edge of the table. To stop this from happening, you might write a condition-controlled loop like this: move forward repeat until (touching table edge)
  • 7. WHILE loops Condition-controlled loops are also called WHILE loops or WHILE-ENDWHILE statements. A WHILE loop code is repeated based on a certain condition. The condition could be 'true' or 'false'. The WHILE loop executes while a condition is true. Whether the condition is met or not is checked at the beginning of the loop. If the condition is 'true' it repeats, if not then the code is not executed. For example, to stop the robot from driving off the edge of a table, you might write a WHILE loop like this: Move forward WHILE I am not touching the table edge
  • 8. DO WHILE loops A similar condition-controlled loop is a DO WHILE loop. This method differs from a WHILE condition-controlled loop in that the condition is checked at the end of the loop. If the condition is ‘true’, the loop repeats. Thus, the code in the loop is executed at least once. count = 1 do print(count) count+=1 while count <4
  • 9. REPEAT UNTIL loops REPEAT UNTIL loops are condition-controlled loops that are found in older languages such as BASIC or PASCAL. The principal is the same as a DO WHILE loop, in that the condition is checked at the end of the loop, thus the behaviour is the same. Consider this pseudo-code example: count = 1 repeat print(count) count+=1 until count >3
  • 10. Infinite loops Condition-controlled loops can result in intentional or unintentional infinite loops. If we wanted to loop indefinitely, we could set a condition that would never be met, thus iterating infinitely. The following examples would result in an infinite loop:
  • 11. Infinite loops WHILE: count = 1 while count <>0: print(count) count +=1
  • 12. Infinite loops DO WHILE: count = 1 do print(count) count+=1 while count <>0
  • 13. Infinite loops REPEAT UNTIL: count = 1 repeat print(count) count+=1 until count =0