Program Development and Flowcharts 2
Program Development and Flowcharts 2
Development
1
Flowcharts
2
Flowcharts
3
Sequence
4
Flowchart: Sequence
Order of execution
indicated by arrows Step C: output number
5
Flowchart: Selection
Arrow labeled Condition
Step A with result of test
if ( condition C1 ) condition test in diamond
{ Step A
<sequence S1>
}
YES NO
else C1 true?
{
<sequence S2>
}
S1 S2
Step C
Step C
6
Example (1)
Sum = num1+num2
Print Sum
End
8
Example (2)
9
Start
Example (2)
Read A and B
Step1: Start
Step2: Read A and B
Step3: If A greater than B then C=A No Yes
Step4: if B greater than A then C=B Is A > B?
Step5: Print C
Step6: End
No C=A
Is B > A?
Yes
C=B
End Print C
10