Professional Documents
Culture Documents
3_1_2_A_CreatingFlowcharts
3_1_2_A_CreatingFlowcharts
# checking condition
Is number >9?
NO
if num % 2 != 0:
YES
print(num, end = " ")
END
Create a Flowchart
• Definition: a flowchart is a schematic
representation of an algorithm or a
process.
• A flowchart abstracts the flow of steps to
complete a task using specialized symbols
as shown in the example.
N
Parts of a Flowchart
Start/end
Input/output
Process
Arrows
Display
Decision
Start/End
• Shape is a rounded rectangle
• Start is required of all flow charts
• Some flow charts may not have an END
Process
• Shape is rectangular
• Process involves the action or the verb
part of the flowchart
• Examples include
– Add 1
– Turn the motor on
– Turn the light off
– Rotate the part
Input/Output
• Shape is a parallelogram
• Indicates that manual operation is needed
• Examples include
– Type in the weight
– Check the balance
– Time the operation
Decision
• Shape is a rhombus
• Outcome is either yes or no
• Examples include
– Is this number larger than
10?
– Does the weight meet
specifications?
– Has the count been
reached?
Arrows
• Arrows indicate the flow of the chart.
• Arrows are drawn from the output of one
block to the input of another.
• Only one arrow can represent outputs.
• Multiple arrows may represent inputs.
Example Flowchart
• Count from 1 to 9 by odd numbers.
• Before attempting to draw the flowchart,
determine what you want the output to be.
• What is the first block (always)?
Step 1
• The output will be 1, 3, 5, 7, 9.
• The Start block is always first.
START
Step 2
The program begins with the number 1.
START
INPUT 1
Step 3
INPUT 1
SAY NUMBER
Step 4
The number 2 will be added to 1 so that
the program will continue to count by odd
numbers.
START
INPUT 1
SAY NUMBER
ADD 2
Step 5 START
INPUT 1
SAY NUMBER
Add a decision block so
that the program will
continue counting until ADD 2
the value is greater than
9. NO
Is number >9?
Step 6 START
INPUT 1
SAY NUMBER
Once the number is
greater than 9, the
ADD 2
program ends.
NO
Is number >9?
YES
END
Your Turn
Create a flow chart that shows how to pour
a glass of milk.