Download
flowchart n.
Skip this Video
Loading SlideShow in 5 Seconds..
FLOWCHART PowerPoint Presentation

FLOWCHART

388 Vues Download Presentation
Télécharger la présentation

FLOWCHART

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. FLOWCHART Programming & Algorithm

  2. Outline • Element of computer • Computer language & Interpreter • Analysis & Algorithm • Algorithm structure

  3. Element of computer

  4. Computer language & Language Translator Computer language • Machine Language • Low Level Language • High Level Language Language Translator • Assembler • Compiler • Interpreter

  5. Analysis & Algorithm Analysis • Answer Analysis • Data Analysis • Process Analysis • Debug Analysis Algorithm • Flowchart • Pseudo code

  6. Introduction to Flowchart • A flowchart is a common type of chart, that represents an algorithm or process, showing the steps as boxes of various kinds, and their order by connecting these with arrows. Flowcharts are used in analyzing, designing, documenting or managing a process or program in various fields

  7. Types of flowcharts • Consist of • Document flowcharts, showing a document flow through system • Data flowcharts, showing data flows in a system • System flowcharts,showing controls at a physical or resource level • Program flowchart, showing the controls in a program within a system

  8. Symbol • Start and end symbols Represented as lozenges, ovals or rounded rectangles, usually containing the word "Start" or "End", or another phrase signaling the start or end of a process, such as "submit enquiry" or "receive product". • Arrows Showing what's called "flow of control" in computer science. An arrow coming from one symbol and ending at another symbol represents that control passes to the symbol the arrow points to.

  9. Symbol • Processing steps Represented as rectangles. Examples: "Add 1 to X"; "replace identified part"; "save changes" or similar. • Input/Output Represented as a parallelogram. Examples: Get X from the user; display X. • A Manual inputrepresented by parallelogram, with the top irregularly sloping up from left to right. An example would be to signify data-entry from a form;

  10. Symbol • Conditional or decision Represented as a diamond (rhombus). These typically contain a Yes/No question or True/False test. This symbol is unique in that it has two arrows coming out of it, usually from the bottom point and right point, one corresponding to Yes or True, and one corresponding to No or False. • A Display Output represented by many rectangle

  11. Flowchart Symbols Symbols of flowchart to standard from ANSI (The American National Standard Institute)

  12. Flowchart Symbols

  13. Flowchart Symbols

  14. Flowchart Symbols

  15. Flowchart Symbols

  16. Flowchart Symbols

  17. Flowchart Symbols

  18. Flowchart Symbols

  19. Usually Symbols Read Reading of Keyboard Read Read Reading of other tools Reading data of Symbols by Keyboard & Other tools

  20. Usually Symbols Display Display on Monitor แสดงผล... Display Display on Printer Display แสดงผล... Display Display on other tools Display data of Symbols by Keyboard & Other tools

  21. Natural Language • Find x from equation x = (a+b-c)/100; if a, b, c manual input from keyboard and display x on monitor. Start Program Sample; Uses crt; Var a, b, c, x : real Begin Clrscr; Readln(a,b,c); x := (a+b-c)/100 Writeln(x:8:2); End. Input a, b, c x <- (a+b-c)/100 x End

  22. Algorithm structure • Sequential • Step to Step • Selection • Select part to true and false • Repetition • Loop

  23. Sequential • Summations of 2 number define a, b by a, b manual input from keyboard and display answer on monitor.

  24. Selection • Consist of 2 selection • if • switch

  25. if structure (Single Selection )

  26. if structure (Single Selection ) • Input number 1 integer manual input from keyboard, brings the number to check number is 0, if true display “Greater than Zero” on monitor

  27. if structure (Double Selection )

  28. if structure (Double Selection ) • Input number 1 integer manual input from keyboard, brings the number to check number is 0, • if true display “Greater than Zero” • and then false display “Less than or Equal to Zero” on monitor

  29. Multi-Selection (if/else if/ else .. Structure)

  30. Multi-Selection (if/else if/ else .. Structure) • Finding Grade • 0-49 E • 50-59 D • 60-69 C • 70-79 B • 80-100 A • Manual input from keyboard and display on monitor

  31. case/switch Structure

  32. case/switch Structure • Manual input from keyboard and display on monitor • Choice 1 + • Choice 2 – • Choice 3 * • Choice 4 /

  33. Repetition • for • while • do .. while/repeat..until

  34. while .. Structure

  35. Summations of number 1 – 10 with while loop while .. Structure

  36. do while Structure & repeat until Structure

  37. do while Structure & repeat until Structure • Summations of number 1 – 10 with do-while loop

  38. for Structure

  39. for Structure • Summations of number 1 – 10 with do-while loop

  40. exercise • 1. จงเขียนอัลกอริทึมแบบคำอธิบายและผังงาน ในการคำนวณยอดชำระค่าน้ำประปา โดยมีเงื่อนไขดังนี้ 1 – 50 หน่วย คิดหน่วยละ 4.25 บาท 51 – 100 หน่วย คิดหน่วยละ 3.25 บาท ตั้งแต่ 101 หน่วยขึ้นไป คิดหน่วยละ 2.25 บาท

  41. exercise • 2.จงเขียนอัลกอริทึมแบบคำอธิบายและผังงาน เพื่อคำนวณค่าเดินทางโดยให้รับค่าระยะทาง 1 จำนวน ซึ่งมีอัตรา ดังนี้ n ระยะทาง 1 - 5 กิโลเมตร คิดค่าเดินทางกิโลเมตร 100 บาท n ระยะทาง 6 - 10 กิโลเมตร คิดค่าเดินทางเพิ่ม จาก 5 กิโลเมตร คิด กิโลเมตรละ 80 บาท n ระยะทาง ตั้งแต่ 11 กิโลเมตรขึ้น ไป คิดค่าเดินทางเพิ่ม จาก 10 กิโลเมตร คิดกิโลเมตรละ 60 บ

  42. exercise • 3.จงเขียนอัลกอริทึมแบบคำอธิบายและผังงาน ของ โปรแกรมตัดเกรด ดังนี้ A 80 – 100 B+ 79 - 75 B 74 – 70 C+ 69 - 65 C 64 – 60 D+ 59 - 55 D 54 – 50 F 49 - 0 • โดยรับค่าอินพุท ตั้งแต่ 0-100 ทางแป้นพิมพ์