Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 5

Programming in Python

FINM32230
Lesson 1 - Flowchart
Flow Charts

 Flow Charts can be used to design and document your program


 Usually done before you write the first line of code
 Clearly states the sequence of execution of various commands in
your program
 Communicates the purpose or function of your program to fellow
coders

 Always design your program before you start coding


 Coding is NOT a Trial and Error process
2
Components of a Flow Chart
Start
Oval : Start/End terminal

Set data Rectangle: Process

Input
data Parallelogram: Input / output

Calculate data Rectangle: Process


Diamond: Decision /Choice
True Decision False

Processing 1 Processing 2

Rectangle: Process

Output/
Display
data Parallelogram: Input / output
3

End Oval : Start/End terminal


Start

Sample Design Set data

Most programs can follow


Input
similar structure as this sample data
design.
Calculate data

More complex flow can be


True Decision False
created to handle more
complicated cases inside the
green dashed box. Processing 1 Processing 2

Note: Circle Symbol is a


junction connector and it’s use
Output/
is optional . Display
data

4
End
Flowchart  Code

Each symbol (except for the Start and End) can be converted into one or
more lines of code in a program

name = input(“Enter name: ”)


enroll= input(“Enter enrolled year: ”)

if enroll == 2014:
status = “year 1”
else:
status = “not year 1”

print(name “ is ” + status + “ student”)

You might also like