1) The document discusses an introduction to flowcharting. It explains that a flowchart is a diagram that depicts the flow of a program and shows basic examples using symbols like rectangles, diamonds, and ovals.
2) It covers the four main structures of flowcharts: sequence, decision, repetition, and case. Sequence shows a series of steps. Decision includes if/else conditional logic. Repetition uses loops like while. Case uses switches.
3) The document provides examples of each structure and how they relate to coding constructs like if/else statements and while loops. It also discusses combining structures and using connectors to link multiple flowchart segments.
3. Take a picture of something. typically,
you choose a specific theme.
For example, a picture of your shoes,
or a picture of something that is on
your workstation or the view outside
your window.
Ask participants to share the picture
on a virtual board.
Start a discussion.
8. THINGS TO PREPARE
• Email address
• Kahoot app installed in your mobile phone
• Google meet app installed in your mobile phone
• Join the google classroom G11 TVL ICT CAFASSO
• Be yourself
8
12. What is a Flowchart?
• A flowchart is a
diagram that depicts
the “flow” of a
program.
START
Display message
“How many
hours did you
work?”
Read Hours
Display message
“How much do
you get paid per
hour?”
Read PayRate
Multiply Hours
by PayRate.
Store result in
GrossPay.
Display
GrossPay
END
13. 13
Basic Flowchart
Symbols
• Terminals
– represented by rounded
rectangles
– indicate a starting or
ending point
START
Display message
“How many
hours did you
work?”
Read Hours
Display message
“How much do
you get paid per
hour?”
Read PayRate
Multiply Hours
by PayRate.
Store result in
GrossPay.
Display
GrossPay
END
Terminal
START
END Terminal
14. 14
Basic Flowchart
Symbols
• Input/Output Operations
– represented by
parallelograms
– indicate an input or output
operation
START
Display message
“How many
hours did you
work?”
Read Hours
Display message
“How much do
you get paid per
hour?”
Read PayRate
Multiply Hours
by PayRate.
Store result in
GrossPay.
Display
GrossPay
END
Display message
“How many
hours did you
work?”
Read Hours
Input/Output
Operation
15. 15
Basic Flowchart
Symbols
• Processes
– represented by rectangles
– indicates a process such as
a mathematical
computation or variable
assignment
START
Display message
“How many
hours did you
work?”
Read Hours
Display message
“How much do
you get paid per
hour?”
Read PayRate
Multiply Hours
by PayRate.
Store result in
GrossPay.
Display
GrossPay
END
Multiply Hours
by PayRate.
Store result in
GrossPay.
Process
17. 17
Sequence Structure
• A series of actions are performed in sequence
• The pay-calculating example was a sequence flowchart.
18. 18
Decision Structure
• The flowchart segment below shows how a decision structure is expressed in
C++ as an if/else statement.
YES
NO
x < y?
Calculate a
as x times 2.
Calculate a
as x plus y.
if (x < y)
a = x * 2;
else
a = x + y;
Flowchart C++ Code
19. 19
Decision Structure
• The flowchart segment below shows a decision structure with only one action to
perform. It is expressed as an if statement in C++ code.
if (x < y)
a = x * 2;
Flowchart C++ Code
YES
NO
x < y?
Calculate a
as x times 2.
20. 20
Repetition Structure
• The flowchart segment below shows a repetition structure expressed in C++ as a
while loop.
while (x < y)
x++;
Flowchart C++ Code
x < y? Add 1 to x
YES
21. 21
Controlling a Repetition Structure
• The action performed by a repetition structure must eventually cause the loop to
terminate. Otherwise, an infinite loop is created.
• In this flowchart segment, x is never changed. Once the loop starts, it will never
end.
• QUESTION: How can this
flowchart be modified so
it is no longer an infinite
loop?
x < y? Display x
YES
22. 22
Controlling a Repetition Structure
• ANSWER: By adding an action within the repetition that changes the value of
x.
x < y? Display x Add 1 to x
YES
23. 23
Case Structure
CASE
years_employed
1 2 3 Other
bonus = 100 bonus = 200 bonus = 400 bonus = 800
If years_employed = 1,
bonus is set to 100
If years_employed = 2,
bonus is set to 200
If years_employed = 3,
bonus is set to 400
If years_employed is
any other value, bonus
is set to 800
25. 25
Modules
•The position of the module
symbol indicates the point the
module is executed.
•A separate flowchart can be
constructed for the module.
START
END
Read Input.
Call calc_pay
function.
Display results.
26. 26
• This flowchart segment
shows two decision
structures combined.
Combining Structures
Display “x is
within limits.”
Display “x is
outside the limits.”
YES
NO
x > min?
x < max?
YES
NO
Display “x is
outside the limits.”
27. 27
Review
• What do each of the following symbols
represent?
(Answer on next slide)
28. 28
Answer
• What do each of the following symbols
represent?
Terminal
Input/Output
Operation
Process
Decision
Connector
Module