งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

Programming & Algorithm

งานนำเสนอที่คล้ายกัน


งานนำเสนอเรื่อง: "Programming & Algorithm"— ใบสำเนางานนำเสนอ:

1 Programming & Algorithm
FLOWCHART Programming & Algorithm

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

3 Element of computer Computer Hardware Software Peopleware

4 Computer language & Language Translator
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 input represented 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) Symbols Description Processing กระบวนการ การคำนวณ Auxiliary กระบวนการสำรอง

12 Flowchart Symbols Symbols Description Subroutine Processing
กระบวนการที่นิยามไว้ การทำงาน ย่อย Input/Output Data ข้อมูล รับหรือแสดงข้อมูลโดยไม่ ระบุชนิดอุปกรณ์ Internal Storage ที่เก็บภายใน Decision Symbol การตัดสินใจ การเปรียบเทียบ

13 Flowchart Symbols Symbols Description Preparation Symbol
การเตรียมการ การกำหนดค่า ล่วงหน้าหรือกำหนดค่าเป็นชุดตัวเลข Manual Input ป้อนข้อมูลด้วยตนเอง การรับข้อมูล เข้าทางแป้นพิมพ์ Manual Control ขั้นตอนที่ทำด้วยตนเอง การควบคุม โปรแกรมทางแป้นพิมพ์ Document Output เอกสารแสดงผล, การแสดงผลทาง เครื่องพิมพ์

14 Flowchart Symbols Symbols Description More Document
เอกสารแสดงผลหลายฉบับ Monitor จอภาพแสดงผล Card การ์ดหรือบัตรเจาะรู ใช้ใส่ข้อมูล Tape เทป (สื่อบันทึกข้อมูล)

15 Flowchart Symbols Symbols Description Start/End Symbol
เริ่มต้น/สิ้นสุด, การเริ่มต้นหรือการ ลงท้าย Connection Symbol จุดเชื่อมต่อในหน้าเดียวกัน ตัวเชื่อมต่อไปหน้าอื่น จุดร่วมการเชื่อมต่อ

16 Flowchart Symbols Symbols Description หรือ ตรวจเทียบ เรียงลำดับ แยก

17 Flowchart Symbols Symbols Description ผนวก ข้อมูลที่เรียง หน่วงเวลา
ที่เก็บแบบเข้าถึงโดยเรียงลำดับ

18 Flowchart Symbols Symbols Description ดิสก์แม่เหล็ก
หน่วยเก็บแบบเข้าถึงโดยตรง Flow Line เส้นแสดงลำดับกิจกรรม Comment Line แสดงคำอธิบายหรือหมายเหตุ

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 Selection Repetition Step to Step
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 E 50-59 D 60-69 C 70-79 B 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 while .. Structure Summations of number 1 – 10 with while loop

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 ระยะทาง กิโลเมตร คิดค่าเดินทางกิโลเมตร 100 บาท n ระยะทาง กิโลเมตร คิดค่าเดินทางเพิ่ม จาก 5 กิโลเมตร คิด กิโลเมตรละ 80 บาท n ระยะทาง ตั้งแต่ 11 กิโลเมตรขึ้น ไป คิดค่าเดินทางเพิ่ม จาก กิโลเมตร คิดกิโลเมตรละ 60 บ

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


ดาวน์โหลด ppt Programming & Algorithm

งานนำเสนอที่คล้ายกัน


Ads by Google