Upcoming SlideShare
×

# 1

383 views

Published on

Published in: Technology, Education
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
383
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
3
0
Likes
0
Embeds 0
No embeds

No notes for slide

### 1

1. 1. Program Flowchart
2. 2. Outline o o o o o o
3. 3. Problem 1. 5 . Analysis . . Flowchart . Input Program ? Testing Output
4. 4. Analysis): 3 • • • Result) input (Problem (Input Data) (Process) (Output Output Memory
5. 5.  o o 2 X, Y Memory Sum 1. Input: 2. Process: Sum = X + Y 3. Output: Sum X X, Y Y Sum
6. 6.  3 o 3 X1, X2, X3 Sum Mean 1. Input: o o X3 2. Process: X2 + X3 = Sum/3 3. Output: Memory X1 X2 X1, X2, X3 Sum Mean Sum = X1 + Mean Mean
7. 7.  N = åiN Xi / N) N X o o o 1. Input: 2. Process: N) o N ) Sum N (1 ) ) Mean X N ) X (N ) (i=1, 2, … , Sum = Sum + X ( ( ( Memory N X Sum Mean
8. 8. (Flowchart) ) (
9. 9. start Read W, L o A = W*L o o Print A end yes check condition yes statement (s) check condition no exit loop no statement 1 statement 2
10. 10. Flowchart (Sequence) start Input Process Output end ( )
11. 11. Flowchart (Sum) start (X, Y) Input X, Y Sum = X+Y Print Sum end Memory X Y Sum 50 100 150
12. 12. 1. 2. 1
13. 13. check condition statement (s) yes no (Statement)
14. 14. 5 Flowchart ( x >= 60) start Memory Input ID,X X X >= 60 yes Print ID,X no … end
15. 15. 2 2 yes statement 1 check condition no statement 2 (Statement 1)
16. 16. 6 2 Flowchart (Female) start (Male) Input ID, Name,Gender Gender= 'M' no Print "Female" end yes Print "Male"
17. 17. 3. n 1 (statement1) (statement2) 1 2 cond1 no 2 cond2 no cond3 ... n-1 (statement n-1) (statement n) no n-1condn-1 n no statement n yes yes yes yes statement1 statement2 statement3 statement n-1
18. 18. 7 start Input ID Name,X Flowchart X >= 80 Memory >>> 80-100 A 7079 B 60-69 C 50-59 D < 50 F Grade = 'A' no X >= 70 ID Name yes yes Grade = 'B' no … X >= 60 no X Grade … X >= 50 no Grade = 'F' Print Grade end yes yes Grade = 'C' Grade = 'D'
19. 19. (Looping) 1. while 2. dowhile 3. for
20. 20. while check condition yes statement(s) no exit loop (Statement)
21. 21. ( ) ( I = 1, 2, 3,1 , 100) … 10 1 1 0 start I = 1, 2, 3, ..., 99, 3 100 1 I=1 I=1 I=1 while I<=100 00I I= +1 yes Print I I = I+1 no end
22. 22. Flowchart ( while) 1+2+...+100 Memory I SUM I = 1, 2, SUM = 3, ..., 100 start 1+2+3+...+100 3 I=1 I=1 00 I=I+ SUM 1 SUM SUM SUM =0 +I … I=1 SUM = 0 while I<100 yes SUM = SUM+I I = I+1 no Print SUM end
23. 23. do- while (Statement) statement(s) check condition yes no exit loop (
24. 24. 9 Flowchart ( Memory 1+2+...+100 do-while) I SUM SUM1, 2, 3, ..., start I = = 100 1+2+3+...+100 3 I=1 I=1 I=1 I=I 00 SUM +1 SUM= SUM 0 SUM+I … SUM = 0 SUM = SUM+I I = I+1 while I<100 yes no Print SUM 24 end24
25. 25. for i=1 to N i <= N statement(s) i> N exit loop ( ( (i=1) (i=N) 1 (i = i+1))
26. 26. 10 Flowchart ( for) 1+2+...+100Memory I SUM = 1, SUM =2, 3, ..., 100 1+2+3+...+100 start 3 I=1 I=1 00 I=I+ 1 for … SUM = 0 for I=1 to 100 no yes Print SUM SUM = SUM+I end
27. 27. 11 Flowchart Memory 1x2x...x10 I = 1, 2, 3, ..., 10 MUL = 1x2x3x...x10 start I MUL 3 I=1 I=1 I=I 0 +1 for … MUL = 1 for I=1 to 10 yes MUL = MUL x I no Print MUL end
28. 28. 12 Flowchart T( T=2) Txi Memory T i R i=1, 2, …, 12, start Input T for i=1 to 12 i <=12 … R=Txi Print T, i, R i > 12 end RR= TxI = 2x1=2 2x2=4 2x3=6 2x4=8 2 x 5 = 10 2 x 6 = 12 2 x 7 = 14 2 x 8 = 16 2 x 9 = 18 2 x10 = 20 2 x11 = 22 2 x12 = 24
29. 29. 13 Flowchart N X2, ..., XN) Memory N X Sum Mean X (X1, start N (åi= 0 Xi/N) Sum Sum =0 Input N … for i=1 to N i <= Input N X Sum=Sum+X i>N Mean = Sum/N Print Mean end N=_ 5 60 x1 = 60 _ 110 x2 = 50 _ 135 x3 = 25 _ x4 = 30 _ 165 x5 = 80 _ 245 Mean = 245/5 =49