Professional Documents
Culture Documents
Flowchart - 3-1-22
Flowchart - 3-1-22
3
Pseudo code
4
Pseudocode Example
6
Flowcharts Symbols
7
End Start Start/End
Print n1 Read n1 Read/Print
End 8
Example 2
• Draw the flow chart for a program that calculates the total salary for
an employee using this equation:
Total Sal = Salary +Overtime
9
Solution
Input start
Salary
Overtime Read Salary
Processing
Total_Sal = Salary +Overtime
Read Overtime
Output
Total_Sal =
Total_Sal
Salary +Overtime
Print Total_Sal
End 10
Example 3
• Draw a flowchart for a program that calculates and prints the sum of
the even integers from 2 to 30.
• Input
• No input.
• Processing
• Sum = 2+4+6+8+……+28+30.
• Output
• sum
11
Solution
Pesudocode:
◼Start the program
◼Create a variable to hold a counter from 2 to 30.
◼Initialize the counter to 2.
◼Create a variable to hold the sum.
◼Initialize the sum to zero.
◼Loop While the counter is less-than-or-equal to 30
◼add the counter to the sum
◼add two to the counter.
◼ repeat until the counter reach 30
◼Print the sum.
◼End of program
12
Solution
Start
Counter=2, Sum=0
yes
no
Counter≤30
yes
Sum= Sum + Counter
Counter=Counter+2
Print Sum
End 13