1 / 104

Flow Charting

Flow Charting. Damian Gordon. Introduction.

cindy
Download Presentation

Flow Charting

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Flow Charting Damian Gordon

  2. Introduction • We mentioned it already, that if we thing of an analyst as being analogous to an architect, and a developer as being analogous to a builder, then the most important thing we can do as analysts is to explain our designs to the developers in a simple and clear way. • How do architects do this?

  3. Flowcharts • So let’s say we want to express the following algorithm: • Read in a number and print it out.

  4. START

  5. START Read in A

  6. START Read in A Print A

  7. START Read in A Print A END

  8. Flowcharts • So let’s say we want to express the following algorithm: • Read in a number and print it out double the number.

  9. START

  10. START Read in A

  11. START Read in A Print A*2

  12. START Read in A Print A*2 END

  13. Or alternatively...

  14. START

  15. START Read in A

  16. START Read in A B = A*2

  17. START B = A * 2 can be read as “B gets the value of A multiplied by 2” Read in A B = A*2

  18. START Read in A B = A*2 Print B

  19. START Read in A B = A*2 Print B END

  20. Flowcharts • So let’s say we want to express the following algorithm: • Read in a number, check if it is odd or even.

  21. START

  22. START Read in A

  23. START Read in A Does A/2 give a remainder?

  24. START Read in A Does A/2 give a remainder? Print “It’s Odd” Yes

  25. START Read in A Does A/2 give a remainder? Print “It’s Odd” Print “It’s Even” No Yes

  26. START Read in A Does A/2 give a remainder? Print “It’s Odd” Print “It’s Even” No Yes END

  27. Flowcharts • So let’s say we want to express the following algorithm to print out the bigger of two numbers: • Read in two numbers, call them A and B. Is A is bigger than B, print out A, otherwise print out B.

  28. START

  29. START Read in A and B

  30. START Read in A and B A>B?

  31. START Read in A and B A>B? Print A Yes

  32. START Read in A and B A>B? Print A Print B No Yes

  33. START Read in A and B A>B? Print A Print B No Yes END

  34. Flowcharts • So let’s say we want to express the following algorithm to print out the bigger of three numbers: • Read in three numbers, call them A, B and C. • If A is bigger than B, then if A is bigger than C, print out A, otherwise print out C. • If B is bigger than A, then if B is bigger than C, print out B, otherwise print out C.

  35. START

  36. START Read in A, B and C

  37. START Read in A, B and C A>B?

  38. START Read in A, B and C A>C? A>B? Yes

  39. START Read in A, B and C A>C? A>B? B>C? No Yes

  40. START Read in A, B and C A>C? A>B? B>C? No Yes No No Print C

  41. START Read in A, B and C A>C? A>B? B>C? No Yes Yes No No Print A Print C

  42. START Read in A, B and C A>C? A>B? B>C? No Yes Yes Yes No No Print A Print C Print B

  43. START Read in A, B and C A>C? A>B? B>C? No Yes Yes Yes No No Print A Print C Print B END

  44. Flowcharts • So let’s say we want to express the following algorithm: • Print out the numbers from 1 to 5

  45. START

  46. START Print 1

  47. START Print 1 Print 2

  48. START Print 1 Print 2 Print 3

  49. START Print 1 Print 2 Print 3 Print 4

More Related