Lesson 6 - CONTROLLING PROGRAM FLOWS.ppt

CamilleJoyVeniegas 9 views 10 slides Mar 09, 2025
Slide 1
Slide 1 of 10
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10

About This Presentation

Program flow in COmputer Programming


Slide Content

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