Algorithm&flowchart
Algorithm&flowchart
Input / Output
Process / Instruction
Decision
Connector / Arrow
The symbols above represent different parts of a flowchart.
The process in a flowchart can be expressed through boxes
and arrows with different sizes and colors. In a flowchart,
we can easily highlight certain elements and the
relationships between each part.
Example1: Sum: To display total of two numbers
Start
Input x,y
Sum = x + y
Display SUM
End
Example 2: Convert Temperature from Fahrenheit (℉) to Celsius (℃)
Start
Algorithm:
Step 1: Read temperature in Fahrenheit,
Step 2: Calculate temperature with formula Read F
C=5/9*(F-32),
Step 3: Print C. C=5/9*(F-32)
Print C
End
Example 3: Determine Whether A Student Passed the Exam or Not:
Algorithm:
Step 1: Input grades of 4 courses M1, M2,
M3 and M4.
Step 2: Calculate the average grade with
formula "Grade=(M1+M2+M3+M4)/4“.
Step 3: If the average grade is less than 60,
print "FAIL", else print "PASS".
Start
Input
M1,M2,M3,M4
Grade= (M1+M2+M3+M4)/4
Yes No
If Grade<60
End