Controlling Program Flow
In this lesson
Sequence Control Structure
Selection Control Structure
If-then, If-then-else
Repetition Control Structure
do-until, do-while
JavaScript Data Types
A program control flow allows
you to direct how the script will
perform the JavaScript
commands in response to the
inputs of your program.
Sequence Control Structure
It shows an action sequencetially
followed by another action. It is executed
in specific order.
All the programs
That were presented
Before in this lesson
Are using sequence
Control structure
Selection Control Structure
It tells the program which action to
perform based on a certain condition.
A condition when evaluates generates
either TRUE or FALSE. Here are some
ways that control structure is
represented.
If-then structure
If-then-else structure
Selection Control Structure
If-then structure
With color?
Color the drawing
End
Selection Control Structure
If-then-else structure
Repetition Control Structure
Also known as Iteration Control
Structure is used when one or more
actions are to be executed repeatedly
based on a certain conditions. Here
are some ways that repetition control
structure is represented.
do-until structure
Do-while structure
Repetition Control Structure
do-until structure
Enter a number
Is number
==10?
TRUE
FALSE
You got it
right!
Example:
Enter
password to
log in
Repetition Control Structure
do-while structure
Announce
seconds left
Seconds
left>0
FALSE
TRUE
STOP

Lesson 6 - CONTROLLING PROGRAM FLOWS.ppt