SlideShare a Scribd company logo
1 of 53
Download to read offline
Mr.Warawut Khangkhan
           Twitter: http://twitter.com/awarawut
Facebook: http://www.facebook.com/AjWarawut
                 E-mail: awarawut@hotmail.com
                           Mobile: 083-0698-410
Objective
 1.                                           F
 2.          F                    F                                        F
 3.          F    F                                       Procedural
    Object-Oriented F
 4.            F                                                 F
 5.                                               F   F
 6.      F                               6                   F         F
                 F   F F


Mr.Warawut                 Chapter 1 Review                                    2
Contents
    Steps in Program Development
    Program Design Methodology
                   Procedural  Object-Oriented
    Objective of Structured Program Design Techniques
    Introduction to Algorithm and Pseudo Code
    Six Basic Computer Operations
    The Three Basic Control Structures



Mr.Warawut      Chapter 1 Review                        3
Mr.Warawut   Chapter 1 Review   4
Steps in Program Development
 1.             (Define the Problem)
 2.     F                 F     (Outline the Solution)
 3.               (Develop and Algorithm)
 4.                 F         (Test the Algorithm for
       Correctness)
 5.              (Programming)
 6.               (Testing)
 7.                            (Document and Maintain
       the Program)

Mr.Warawut       Chapter 1 Review                        5
Define the Program
    Inputs
    Outputs
    Processing




Mr.Warawut       Chapter 1 Review   6
Outline the Solution
                         F           F                              (       )
             F                                          F       F       F
                                           F
                 F                   F              F       (Subtask)
                 F               F       F F
                     F       F             F
                                  F      F
                                 (Logic)



Mr.Warawut                       Chapter 1 Review                               7
Develop and Algorithm
                F                       F

             F (Pseudo Code)                F F
                 F




Mr.Warawut           Chapter 1 Review             8
Test the Algorithm for Correctness
                                    F   F
             F




Mr.Warawut       Chapter 1 Review           9
Programming
                 F                          F   F   F
    (        )
        F                  (High Language)              F C,
    PASCAL           F




Mr.Warawut               Chapter 1 Review                      10
Testing
          F        F                          F       F   F       F

                  (Syntax Errors)
              (Logic Errors)
      F        F                    F     F       F           F




Mr.Warawut             Chapter 1 Review                               11
Document and Maintain the
Program
                                                     F   F
                 F                               F
                                             F
                       (External Document) F                 F   F
             F                     F
                     (Internal Document)
                                         F




Mr.Warawut            Chapter 1 Review                               12
Mr.Warawut   Chapter 1 Review   13
Program Design Methodology
                                                         Procedure-Driven
                                     -                        (Processes)                 F           (Functions)
                                                         Event-Driven
                                     -               F                F                                               F       F
                 F                                            F
                                                         Data-Driven
                                     - F                                      F                               F                       F
             F                                   F        F       F                               F   F                   F
                         F   F             F                              F           F                   F
                                 F                                                F           F                   F               F       F
                     F

Mr.Warawut                                 Chapter 1 Review                                                                                   14
Mr.Warawut   Chapter 1 Review   15
Procedural
Object-
Object-Oriented
                    F (Top-Down Development)
                         (Modular Design)
               (Object-Oriented Programming)




Mr.Warawut   Chapter 1 Review                  16
F                                        F

                               Control Module
                                     start
                                call module 1
                                call module 2
                                call module 3
                                     stop




       Module 1                      Module 2   Module 3
        begin                         begin        begin
         do 1                          do x     if x then y
         do 2                          do y         else z
         do 3                          do z       do abc
        return                        return       return

Mr.Warawut        Chapter 1 Review                            17
F




          : http://www.chapterpiece.com/software-development-
       process/2010/04/13/how-to-build-software-3/
Mr.Warawut           Chapter 1 Review                           18
Mr.Warawut   Chapter 1 Review   19
Objective of Structured Program
Design Techniques
 1.         F       F                                           F
        F               F                      F
 2.                                  F                 FF
 3.             F                                  F        F
 4.




Mr.Warawut                  Chapter 1 Review                        20
Mr.Warawut   Chapter 1 Review   21
Introduction to Algorithm and
Pseudo Code
 Algorithm
      F                                     F               F   F       F
                            F          F            F                       F
                                                F       F           F
             F   F   F            F




Mr.Warawut               Chapter 1 Review                                       22
Example Algorithm
                 F
 1.
 2.      F               F
 3.                                F
 4.
 5.          F
 6.
 7.                  3


Mr.Warawut                   Chapter 1 Review   23
F
                     F
 1.              F       F                  F   F           F         F
 2.              F                      F               F        F F                  F
 3.                                                 F                     F       F       F
                                                                F F
 4.          F




Mr.Warawut                   Chapter 1 Review                                                 24
Example Algorithm
                F
 turn on calculator
 clear calculator
 repeat the following instructions
    key in baht amount
    key in decimal point (.)
    key in satang amount
    press addition(+) key
 until all prices have been entered
 write down total price
 turn off calculator

Mr.Warawut      Chapter 1 Review      25
Introduction to Algorithm and
Pseudo Code (Cont.)
 Pseudo Code
      F
          F                        F
            F




Mr.Warawut      Chapter 1 Review       26
F
 1.         F                                           (Statement) F                              F
                                F F
 2.                                 F
 3.                     F F   F F                           F                                 (Keywords) F F
                                  F                             F               F                      F     FF
        F
 4.                 F                           F                                   F                  F
                                            F
 5.             F                                   F                       F           F F                       F F
                                        F               F               F                      F           F
Mr.Warawut                        Chapter 1 Review                                                                      27
Mr.Warawut   Chapter 1 Review   28
Six Basic Computer Operations
 1.              F            F             F
 2.              F                              F F
 3.              F                      F
 4.          F                      F                 F
 5.          F                                            F
 6.          F                                   F




Mr.Warawut           Chapter 1 Review                         29
F                                      F                         F
                   F       F       (       ) F      F                             F             F           F               F
         F F                               F    F F                       F           F                         F   F   F
                               F       F         F F                               F
               F       F                 F     read                               get               F                           F
        read F                                         F          F                       F F
        get F                                F                F       F

             read studentName
             get systemDate
             read number1, number2
             get taxCode
Mr.Warawut                                 Chapter 1 Review                                                                         30
F                                               F F
                F         F           print, write, put, output           display
        print F                F           F        F
        write F                    F   F                    F
        put, output                display     F        F       F


         print “Program Completed”
         write customer record to master file
         put name, address and postcode
         output totalTax
         display “End of data”

Mr.Warawut              Chapter 1 Review                                            31
F                                      F F (Cont.)
             prompt          F               F       F   F   get,   F
               F                 F F F           F
         promt for studentMark
         get studentMark




Mr.Warawut                Chapter 1 Review                              32
F                                  F
             F       F
                     F+ F                  (add)
                     F– F                 (subtract)
                     F* F                 (multiply)
                     F/ F                 (divide)
                     F() F                             /
                 F                         F    F compute       calculate
         divide totalMarks by studentCount
         salesTax costPrice * 0.10
         compute C = (F – 32) * 5 / 9
Mr.Warawut                   Chapter 1 Review                               33
F                                  F                       F
                  F3
 1.           F        initialize                 F set           F   F       F
 2.           F         F         =                                       F       F
 3.          F         store                      F       F
         initialize totalPrice to zero
         set studentCount to 0
         totalPrice = costPrice + salesTax
         totalPrice costPrice + salesTax
         store customerId in lastCustomerID


Mr.Warawut                     Chapter 1 Review                                           34
F
    F
        F if…then…else                 F   end if
         if employeeStatus is partTime then
            add 1 to partTimeCount
         else
            add 1 to fullTimeCount
         end if




Mr.Warawut          Chapter 1 Review                35
F                                     F
       F dowhile…enddo                    repeat…until
         dowhile file_flag <> “eof”
           read student record
           print studentName, address to report
           add 1 to studentTotal
         enddo
         eof – End Of File




Mr.Warawut             Chapter 1 Review                      36
Mr.Warawut   Chapter 1 Review   37
The Three Basic Control Structures
    Sequence
    Selection
    Repetition




Mr.Warawut       Chapter 1 Review   38
Sequence Format
  statement a
  statement b
  statement c
     :
     :




Mr.Warawut      Chapter 1 Review   39
Example: Sequence
  add 1 to pageCount
  print heading line1
  print heading line2
  set lineCount to zero
  read customer record




Mr.Warawut     Chapter 1 Review   40
Selection Format
  if condition p is true then
     statement(s) in true case
  else
     statement(s) in false case
  end if




Mr.Warawut      Chapter 1 Review   41
Example: Simple IF Statement
  if accountBalance < 300000 then
     serviceCharge = 5.00
  else
     serviceCharge = 2.00
  end if




Mr.Warawut    Chapter 1 Review      42
Example: Null False Branch
  if employeeStatus = partTime then
     add 1 to partTimeCount
  end if




Mr.Warawut    Chapter 1 Review        43
Example: Combined IF Statement 1
  if employeeStatus = partTime
     and employeeGender = female then
       add 1 to partTimeCount
  end if




Mr.Warawut    Chapter 1 Review          44
Example: Combined IF Statement 2
  if (recordCode = “23” or updateCode = delete)
     and accountBalance = zero then
        delete customer record
  end if




Mr.Warawut     Chapter 1 Review                   45
Example: Combined IF Statement 3
  if not (recordCode = “23”
     and updateCode = delete) then
        update customer record
  end if




Mr.Warawut    Chapter 1 Review       46
Example: Nested IF Statement 1
 if recordCode = “A” then
    increment counter_A
 else
    if recordCode = “B” then
       increment counter_B
    else
       if recordCode = “C” then
           increment counter_C
       else
           increment errorCounter
       end if
    end if
 end if
Mr.Warawut       Chapter 1 Review   47
Example: Nested IF Statement 2
 if employeeStatus = partTime then
    if employeeGender = female then
       if employeeAge > 30 then
           add 1 to matureFemaleEmployee
       else
           add 1 to youngFemaleEmployee
       end if
    else
       add 1 to maleEmployee
    end if
 else
    add 1 to fullTimeEmployee
 end if
Mr.Warawut      Chapter 1 Review           48
Repetition Format
 dowhile

  dowhile condition p is true
    statement block
  enddo




Mr.Warawut     Chapter 1 Review   49
Repetition Format (Cont.)
 repeat…until

  repeat
     statement
     statement
        :
        :
  until condition is true


Mr.Warawut      Chapter 1 Review   50
Example: dowhile loop 1
  set studentTotal to zero
  dowhile studentTatal < 50
     read student record
     print studentName, address to report
     add 1 to studentTotal
  enddo




Mr.Warawut     Chapter 1 Review             51
Example: dowhile loop 2
  Process Student_record
     set studentCount to zero
     read student record
     dowhile studentNumber not equal 999
        write student record
        increment studentCount
        read student record
     enddo
     print studentCount
  end
Mr.Warawut    Chapter 1 Review             52
Example: repeat…until loop
 Process Student_record
    set studentCount to zero
    repeat
       read student record
       if studentNumber not equal 999
          write student record
          increment studentCount
       end if
    until studentNumber = 99
    print studentCount
 end

Mr.Warawut    Chapter 1 Review          53

More Related Content

What's hot

การจัดการเรียนการสอน
การจัดการเรียนการสอนการจัดการเรียนการสอน
การจัดการเรียนการสอนAnanpha Dear
 
1 โลกและการเปลี่ยนแปลง
1 โลกและการเปลี่ยนแปลง1 โลกและการเปลี่ยนแปลง
1 โลกและการเปลี่ยนแปลงmuang82
 
การขับถ่ายของสัตว์
การขับถ่ายของสัตว์การขับถ่ายของสัตว์
การขับถ่ายของสัตว์Thanyamon Chat.
 
ธรรมชาติของสิ่งมีชีวิต
ธรรมชาติของสิ่งมีชีวิตธรรมชาติของสิ่งมีชีวิต
ธรรมชาติของสิ่งมีชีวิตThanyamon Chat.
 
หน่วยที่ 1 บทนำ
หน่วยที่ 1 บทนำหน่วยที่ 1 บทนำ
หน่วยที่ 1 บทนำkrusarawut
 
Lesson 1 Intro
Lesson 1 IntroLesson 1 Intro
Lesson 1 Introkrusarawut
 
ระบบหมุนเวียน
ระบบหมุนเวียนระบบหมุนเวียน
ระบบหมุนเวียนThanyamon Chat.
 
ระบบหายใจกับการรักษาดุลยภาพของร่างกาย(มนุษย์)
ระบบหายใจกับการรักษาดุลยภาพของร่างกาย(มนุษย์)ระบบหายใจกับการรักษาดุลยภาพของร่างกาย(มนุษย์)
ระบบหายใจกับการรักษาดุลยภาพของร่างกาย(มนุษย์)Thanyamon Chat.
 
ระบบน้ำเหลืองกับภูมิคุ้มกัน
ระบบน้ำเหลืองกับภูมิคุ้มกันระบบน้ำเหลืองกับภูมิคุ้มกัน
ระบบน้ำเหลืองกับภูมิคุ้มกันThanyamon Chat.
 
Ch01 introduction-web
Ch01 introduction-webCh01 introduction-web
Ch01 introduction-webWarawut
 
Personality test
Personality testPersonality test
Personality testpooyu
 
ระบบน้ำเหลืองกับภูมิคุ้มกัน(Hant out)
ระบบน้ำเหลืองกับภูมิคุ้มกัน(Hant out)ระบบน้ำเหลืองกับภูมิคุ้มกัน(Hant out)
ระบบน้ำเหลืองกับภูมิคุ้มกัน(Hant out)Thanyamon Chat.
 
เซลล์ของสิ่งมีชีวิต
เซลล์ของสิ่งมีชีวิตเซลล์ของสิ่งมีชีวิต
เซลล์ของสิ่งมีชีวิตThanyamon Chat.
 
สารและสมบัติของสารและการจำแนก
สารและสมบัติของสารและการจำแนกสารและสมบัติของสารและการจำแนก
สารและสมบัติของสารและการจำแนกmaechai21
 
นำเสนออาหาร
นำเสนออาหารนำเสนออาหาร
นำเสนออาหารnonglakkrubom
 
เปิดประตูสู่โลกออนไลน์ไปกับเทคโนโลยีสุดล้ำจาก ททท
เปิดประตูสู่โลกออนไลน์ไปกับเทคโนโลยีสุดล้ำจาก ทททเปิดประตูสู่โลกออนไลน์ไปกับเทคโนโลยีสุดล้ำจาก ททท
เปิดประตูสู่โลกออนไลน์ไปกับเทคโนโลยีสุดล้ำจาก ทททnattatira
 

What's hot (20)

การจัดการเรียนการสอน
การจัดการเรียนการสอนการจัดการเรียนการสอน
การจัดการเรียนการสอน
 
1 โลกและการเปลี่ยนแปลง
1 โลกและการเปลี่ยนแปลง1 โลกและการเปลี่ยนแปลง
1 โลกและการเปลี่ยนแปลง
 
การขับถ่ายของสัตว์
การขับถ่ายของสัตว์การขับถ่ายของสัตว์
การขับถ่ายของสัตว์
 
ธรรมชาติของสิ่งมีชีวิต
ธรรมชาติของสิ่งมีชีวิตธรรมชาติของสิ่งมีชีวิต
ธรรมชาติของสิ่งมีชีวิต
 
หน่วยที่ 1 บทนำ
หน่วยที่ 1 บทนำหน่วยที่ 1 บทนำ
หน่วยที่ 1 บทนำ
 
Lesson 1 Intro
Lesson 1 IntroLesson 1 Intro
Lesson 1 Intro
 
ระบบหมุนเวียน
ระบบหมุนเวียนระบบหมุนเวียน
ระบบหมุนเวียน
 
ระบบหายใจกับการรักษาดุลยภาพของร่างกาย(มนุษย์)
ระบบหายใจกับการรักษาดุลยภาพของร่างกาย(มนุษย์)ระบบหายใจกับการรักษาดุลยภาพของร่างกาย(มนุษย์)
ระบบหายใจกับการรักษาดุลยภาพของร่างกาย(มนุษย์)
 
ระบบน้ำเหลืองกับภูมิคุ้มกัน
ระบบน้ำเหลืองกับภูมิคุ้มกันระบบน้ำเหลืองกับภูมิคุ้มกัน
ระบบน้ำเหลืองกับภูมิคุ้มกัน
 
Ch01 introduction-web
Ch01 introduction-webCh01 introduction-web
Ch01 introduction-web
 
Personality test
Personality testPersonality test
Personality test
 
ระบบน้ำเหลืองกับภูมิคุ้มกัน(Hant out)
ระบบน้ำเหลืองกับภูมิคุ้มกัน(Hant out)ระบบน้ำเหลืองกับภูมิคุ้มกัน(Hant out)
ระบบน้ำเหลืองกับภูมิคุ้มกัน(Hant out)
 
Fair use
Fair useFair use
Fair use
 
เซลล์ของสิ่งมีชีวิต
เซลล์ของสิ่งมีชีวิตเซลล์ของสิ่งมีชีวิต
เซลล์ของสิ่งมีชีวิต
 
โครงสร้างภาษาซี2
โครงสร้างภาษาซี2โครงสร้างภาษาซี2
โครงสร้างภาษาซี2
 
สารและสมบัติของสารและการจำแนก
สารและสมบัติของสารและการจำแนกสารและสมบัติของสารและการจำแนก
สารและสมบัติของสารและการจำแนก
 
นำเสนออาหาร
นำเสนออาหารนำเสนออาหาร
นำเสนออาหาร
 
จำนวนจริง
จำนวนจริงจำนวนจริง
จำนวนจริง
 
Manual openprojectb
Manual openprojectbManual openprojectb
Manual openprojectb
 
เปิดประตูสู่โลกออนไลน์ไปกับเทคโนโลยีสุดล้ำจาก ททท
เปิดประตูสู่โลกออนไลน์ไปกับเทคโนโลยีสุดล้ำจาก ทททเปิดประตูสู่โลกออนไลน์ไปกับเทคโนโลยีสุดล้ำจาก ททท
เปิดประตูสู่โลกออนไลน์ไปกับเทคโนโลยีสุดล้ำจาก ททท
 

Similar to พื้นฐานการออกแบบโปรแกรม

การพัฒนาซอฟต์แวร์และวิเคราะห์การแก้ปัญหา
การพัฒนาซอฟต์แวร์และวิเคราะห์การแก้ปัญหาการพัฒนาซอฟต์แวร์และวิเคราะห์การแก้ปัญหา
การพัฒนาซอฟต์แวร์และวิเคราะห์การแก้ปัญหาWarawut
 
Chapter 2 Strategy & Information System
Chapter 2 Strategy & Information SystemChapter 2 Strategy & Information System
Chapter 2 Strategy & Information SystemWarawut
 
Business Computer Project 1
Business Computer Project 1Business Computer Project 1
Business Computer Project 1Warawut
 
กลุ่ม3
กลุ่ม3กลุ่ม3
กลุ่ม3bannoi001
 
Display Table Demo
Display Table DemoDisplay Table Demo
Display Table DemoWarawut
 
การออกแบบและพัฒนาเว็บไซต์
การออกแบบและพัฒนาเว็บไซต์การออกแบบและพัฒนาเว็บไซต์
การออกแบบและพัฒนาเว็บไซต์Warawut
 
Management Information System 5
Management Information System 5Management Information System 5
Management Information System 5Warawut
 
P&MSP2012 - Version Control Systems
P&MSP2012 - Version Control SystemsP&MSP2012 - Version Control Systems
P&MSP2012 - Version Control SystemsDaniele Dell'Aglio
 
Session and Cookie
Session and CookieSession and Cookie
Session and CookieWarawut
 
การใช้เครื่องมือ (Tools) พื้นฐานในโปรแกรม Adobe Photoshop CS3 ที่มา http://...
การใช้เครื่องมือ (Tools)  พื้นฐานในโปรแกรม Adobe  Photoshop CS3 ที่มา http://...การใช้เครื่องมือ (Tools)  พื้นฐานในโปรแกรม Adobe  Photoshop CS3 ที่มา http://...
การใช้เครื่องมือ (Tools) พื้นฐานในโปรแกรม Adobe Photoshop CS3 ที่มา http://...เชาวลักษณ์ ชาวงษ์
 
หลักการออกแบบและพัฒนาเว็บไซท์
หลักการออกแบบและพัฒนาเว็บไซท์หลักการออกแบบและพัฒนาเว็บไซท์
หลักการออกแบบและพัฒนาเว็บไซท์Warawut
 
พื้นฐานภาษาสำหรับพัฒนาเว็บไซต์
พื้นฐานภาษาสำหรับพัฒนาเว็บไซต์พื้นฐานภาษาสำหรับพัฒนาเว็บไซต์
พื้นฐานภาษาสำหรับพัฒนาเว็บไซต์Warawut
 
Java Web Service
Java Web ServiceJava Web Service
Java Web Servicevongthow
 
คู่มือโปรแกรม Book mark2551
คู่มือโปรแกรม Book mark2551  คู่มือโปรแกรม Book mark2551
คู่มือโปรแกรม Book mark2551 Narongchai Wanmanee
 

Similar to พื้นฐานการออกแบบโปรแกรม (20)

การพัฒนาซอฟต์แวร์และวิเคราะห์การแก้ปัญหา
การพัฒนาซอฟต์แวร์และวิเคราะห์การแก้ปัญหาการพัฒนาซอฟต์แวร์และวิเคราะห์การแก้ปัญหา
การพัฒนาซอฟต์แวร์และวิเคราะห์การแก้ปัญหา
 
Chapter 2 Strategy & Information System
Chapter 2 Strategy & Information SystemChapter 2 Strategy & Information System
Chapter 2 Strategy & Information System
 
Flash unit 1
Flash unit 1Flash unit 1
Flash unit 1
 
Business Computer Project 1
Business Computer Project 1Business Computer Project 1
Business Computer Project 1
 
กลุ่ม3
กลุ่ม3กลุ่ม3
กลุ่ม3
 
ERP
ERPERP
ERP
 
Display Table Demo
Display Table DemoDisplay Table Demo
Display Table Demo
 
การออกแบบและพัฒนาเว็บไซต์
การออกแบบและพัฒนาเว็บไซต์การออกแบบและพัฒนาเว็บไซต์
การออกแบบและพัฒนาเว็บไซต์
 
Management Information System 5
Management Information System 5Management Information System 5
Management Information System 5
 
Index with Word 2007
Index with Word 2007Index with Word 2007
Index with Word 2007
 
P&MSP2012 - Version Control Systems
P&MSP2012 - Version Control SystemsP&MSP2012 - Version Control Systems
P&MSP2012 - Version Control Systems
 
Brief create list-km090354
Brief create list-km090354Brief create list-km090354
Brief create list-km090354
 
Comp4
Comp4Comp4
Comp4
 
Seminar It
Seminar ItSeminar It
Seminar It
 
Session and Cookie
Session and CookieSession and Cookie
Session and Cookie
 
การใช้เครื่องมือ (Tools) พื้นฐานในโปรแกรม Adobe Photoshop CS3 ที่มา http://...
การใช้เครื่องมือ (Tools)  พื้นฐานในโปรแกรม Adobe  Photoshop CS3 ที่มา http://...การใช้เครื่องมือ (Tools)  พื้นฐานในโปรแกรม Adobe  Photoshop CS3 ที่มา http://...
การใช้เครื่องมือ (Tools) พื้นฐานในโปรแกรม Adobe Photoshop CS3 ที่มา http://...
 
หลักการออกแบบและพัฒนาเว็บไซท์
หลักการออกแบบและพัฒนาเว็บไซท์หลักการออกแบบและพัฒนาเว็บไซท์
หลักการออกแบบและพัฒนาเว็บไซท์
 
พื้นฐานภาษาสำหรับพัฒนาเว็บไซต์
พื้นฐานภาษาสำหรับพัฒนาเว็บไซต์พื้นฐานภาษาสำหรับพัฒนาเว็บไซต์
พื้นฐานภาษาสำหรับพัฒนาเว็บไซต์
 
Java Web Service
Java Web ServiceJava Web Service
Java Web Service
 
คู่มือโปรแกรม Book mark2551
คู่มือโปรแกรม Book mark2551  คู่มือโปรแกรม Book mark2551
คู่มือโปรแกรม Book mark2551
 

More from Warawut

Database design
Database designDatabase design
Database designWarawut
 
Object-Oriented Programming 10
Object-Oriented Programming 10Object-Oriented Programming 10
Object-Oriented Programming 10Warawut
 
Object-Oriented Programming 9
Object-Oriented Programming 9Object-Oriented Programming 9
Object-Oriented Programming 9Warawut
 
Object-Oriented Programming 8
Object-Oriented Programming 8Object-Oriented Programming 8
Object-Oriented Programming 8Warawut
 
Object-Oriented Programming 7
Object-Oriented Programming 7Object-Oriented Programming 7
Object-Oriented Programming 7Warawut
 
Object-Oriented Programming 6
Object-Oriented Programming 6Object-Oriented Programming 6
Object-Oriented Programming 6Warawut
 
Management Information System 6
Management Information System 6Management Information System 6
Management Information System 6Warawut
 
Object-Oriented Programming 5
Object-Oriented Programming 5Object-Oriented Programming 5
Object-Oriented Programming 5Warawut
 
Business Computer Project 3
Business Computer Project 3Business Computer Project 3
Business Computer Project 3Warawut
 
Management Information System 3
Management Information System 3Management Information System 3
Management Information System 3Warawut
 
Business Computer Project 2
Business Computer Project 2Business Computer Project 2
Business Computer Project 2Warawut
 
Object-Oriented Programming 4
Object-Oriented Programming 4Object-Oriented Programming 4
Object-Oriented Programming 4Warawut
 
Chapter 1 Organization & MIS
Chapter 1 Organization & MISChapter 1 Organization & MIS
Chapter 1 Organization & MISWarawut
 
Object-Oriented Programming 3
Object-Oriented Programming 3Object-Oriented Programming 3
Object-Oriented Programming 3Warawut
 
Object-Oriented Programming 2
Object-Oriented Programming 2Object-Oriented Programming 2
Object-Oriented Programming 2Warawut
 
Object-Oriented Programming 1
Object-Oriented Programming 1Object-Oriented Programming 1
Object-Oriented Programming 1Warawut
 
Upload File
Upload FileUpload File
Upload FileWarawut
 
Form Validation
Form ValidationForm Validation
Form ValidationWarawut
 
Tips & Track
Tips & TrackTips & Track
Tips & TrackWarawut
 

More from Warawut (20)

Database design
Database designDatabase design
Database design
 
Object-Oriented Programming 10
Object-Oriented Programming 10Object-Oriented Programming 10
Object-Oriented Programming 10
 
Object-Oriented Programming 9
Object-Oriented Programming 9Object-Oriented Programming 9
Object-Oriented Programming 9
 
Object-Oriented Programming 8
Object-Oriented Programming 8Object-Oriented Programming 8
Object-Oriented Programming 8
 
Object-Oriented Programming 7
Object-Oriented Programming 7Object-Oriented Programming 7
Object-Oriented Programming 7
 
Object-Oriented Programming 6
Object-Oriented Programming 6Object-Oriented Programming 6
Object-Oriented Programming 6
 
Management Information System 6
Management Information System 6Management Information System 6
Management Information System 6
 
Object-Oriented Programming 5
Object-Oriented Programming 5Object-Oriented Programming 5
Object-Oriented Programming 5
 
Business Computer Project 3
Business Computer Project 3Business Computer Project 3
Business Computer Project 3
 
Management Information System 3
Management Information System 3Management Information System 3
Management Information System 3
 
Business Computer Project 2
Business Computer Project 2Business Computer Project 2
Business Computer Project 2
 
Object-Oriented Programming 4
Object-Oriented Programming 4Object-Oriented Programming 4
Object-Oriented Programming 4
 
Chapter 1 Organization & MIS
Chapter 1 Organization & MISChapter 1 Organization & MIS
Chapter 1 Organization & MIS
 
Object-Oriented Programming 3
Object-Oriented Programming 3Object-Oriented Programming 3
Object-Oriented Programming 3
 
Object-Oriented Programming 2
Object-Oriented Programming 2Object-Oriented Programming 2
Object-Oriented Programming 2
 
Object-Oriented Programming 1
Object-Oriented Programming 1Object-Oriented Programming 1
Object-Oriented Programming 1
 
Upload File
Upload FileUpload File
Upload File
 
Login
LoginLogin
Login
 
Form Validation
Form ValidationForm Validation
Form Validation
 
Tips & Track
Tips & TrackTips & Track
Tips & Track
 

Recently uploaded

Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxDhatriParmar
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfPrerana Jadhav
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationdeepaannamalai16
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsPooky Knightsmith
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...DhatriParmar
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseCeline George
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...Nguyen Thanh Tu Collection
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQuiz Club NITW
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...DhatriParmar
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptxmary850239
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 

Recently uploaded (20)

Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of EngineeringFaculty Profile prashantha K EEE dept Sri Sairam college of Engineering
Faculty Profile prashantha K EEE dept Sri Sairam college of Engineering
 
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptxMan or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
Man or Manufactured_ Redefining Humanity Through Biopunk Narratives.pptx
 
Narcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdfNarcotic and Non Narcotic Analgesic..pdf
Narcotic and Non Narcotic Analgesic..pdf
 
Congestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentationCongestive Cardiac Failure..presentation
Congestive Cardiac Failure..presentation
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Mental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young mindsMental Health Awareness - a toolkit for supporting young minds
Mental Health Awareness - a toolkit for supporting young minds
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
Blowin' in the Wind of Caste_ Bob Dylan's Song as a Catalyst for Social Justi...
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"Mattingly "AI & Prompt Design: Large Language Models"
Mattingly "AI & Prompt Design: Large Language Models"
 
How to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 DatabaseHow to Make a Duplicate of Your Odoo 17 Database
How to Make a Duplicate of Your Odoo 17 Database
 
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
31 ĐỀ THI THỬ VÀO LỚP 10 - TIẾNG ANH - FORM MỚI 2025 - 40 CÂU HỎI - BÙI VĂN V...
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITWQ-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
Q-Factor HISPOL Quiz-6th April 2024, Quiz Club NITW
 
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
Beauty Amidst the Bytes_ Unearthing Unexpected Advantages of the Digital Wast...
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx4.11.24 Poverty and Inequality in America.pptx
4.11.24 Poverty and Inequality in America.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 

พื้นฐานการออกแบบโปรแกรม

  • 1. Mr.Warawut Khangkhan Twitter: http://twitter.com/awarawut Facebook: http://www.facebook.com/AjWarawut E-mail: awarawut@hotmail.com Mobile: 083-0698-410
  • 2. Objective 1. F 2. F F F 3. F F Procedural Object-Oriented F 4. F F 5. F F 6. F 6 F F F F F Mr.Warawut Chapter 1 Review 2
  • 3. Contents Steps in Program Development Program Design Methodology Procedural Object-Oriented Objective of Structured Program Design Techniques Introduction to Algorithm and Pseudo Code Six Basic Computer Operations The Three Basic Control Structures Mr.Warawut Chapter 1 Review 3
  • 4. Mr.Warawut Chapter 1 Review 4
  • 5. Steps in Program Development 1. (Define the Problem) 2. F F (Outline the Solution) 3. (Develop and Algorithm) 4. F (Test the Algorithm for Correctness) 5. (Programming) 6. (Testing) 7. (Document and Maintain the Program) Mr.Warawut Chapter 1 Review 5
  • 6. Define the Program Inputs Outputs Processing Mr.Warawut Chapter 1 Review 6
  • 7. Outline the Solution F F ( ) F F F F F F F F (Subtask) F F F F F F F F F (Logic) Mr.Warawut Chapter 1 Review 7
  • 8. Develop and Algorithm F F F (Pseudo Code) F F F Mr.Warawut Chapter 1 Review 8
  • 9. Test the Algorithm for Correctness F F F Mr.Warawut Chapter 1 Review 9
  • 10. Programming F F F F ( ) F (High Language) F C, PASCAL F Mr.Warawut Chapter 1 Review 10
  • 11. Testing F F F F F F (Syntax Errors) (Logic Errors) F F F F F F Mr.Warawut Chapter 1 Review 11
  • 12. Document and Maintain the Program F F F F F (External Document) F F F F F (Internal Document) F Mr.Warawut Chapter 1 Review 12
  • 13. Mr.Warawut Chapter 1 Review 13
  • 14. Program Design Methodology Procedure-Driven - (Processes) F (Functions) Event-Driven - F F F F F F Data-Driven - F F F F F F F F F F F F F F F F F F F F F F F F Mr.Warawut Chapter 1 Review 14
  • 15. Mr.Warawut Chapter 1 Review 15
  • 16. Procedural Object- Object-Oriented F (Top-Down Development) (Modular Design) (Object-Oriented Programming) Mr.Warawut Chapter 1 Review 16
  • 17. F F Control Module start call module 1 call module 2 call module 3 stop Module 1 Module 2 Module 3 begin begin begin do 1 do x if x then y do 2 do y else z do 3 do z do abc return return return Mr.Warawut Chapter 1 Review 17
  • 18. F : http://www.chapterpiece.com/software-development- process/2010/04/13/how-to-build-software-3/ Mr.Warawut Chapter 1 Review 18
  • 19. Mr.Warawut Chapter 1 Review 19
  • 20. Objective of Structured Program Design Techniques 1. F F F F F F 2. F FF 3. F F F 4. Mr.Warawut Chapter 1 Review 20
  • 21. Mr.Warawut Chapter 1 Review 21
  • 22. Introduction to Algorithm and Pseudo Code Algorithm F F F F F F F F F F F F F F F F Mr.Warawut Chapter 1 Review 22
  • 23. Example Algorithm F 1. 2. F F 3. F 4. 5. F 6. 7. 3 Mr.Warawut Chapter 1 Review 23
  • 24. F F 1. F F F F F F 2. F F F F F F 3. F F F F F F 4. F Mr.Warawut Chapter 1 Review 24
  • 25. Example Algorithm F turn on calculator clear calculator repeat the following instructions key in baht amount key in decimal point (.) key in satang amount press addition(+) key until all prices have been entered write down total price turn off calculator Mr.Warawut Chapter 1 Review 25
  • 26. Introduction to Algorithm and Pseudo Code (Cont.) Pseudo Code F F F F Mr.Warawut Chapter 1 Review 26
  • 27. F 1. F (Statement) F F F F 2. F 3. F F F F F (Keywords) F F F F F F FF F 4. F F F F F 5. F F F F F F F F F F F F Mr.Warawut Chapter 1 Review 27
  • 28. Mr.Warawut Chapter 1 Review 28
  • 29. Six Basic Computer Operations 1. F F F 2. F F F 3. F F 4. F F F 5. F F 6. F F Mr.Warawut Chapter 1 Review 29
  • 30. F F F F F ( ) F F F F F F F F F F F F F F F F F F F F F F F F read get F F read F F F F F get F F F F read studentName get systemDate read number1, number2 get taxCode Mr.Warawut Chapter 1 Review 30
  • 31. F F F F F print, write, put, output display print F F F F write F F F F put, output display F F F print “Program Completed” write customer record to master file put name, address and postcode output totalTax display “End of data” Mr.Warawut Chapter 1 Review 31
  • 32. F F F (Cont.) prompt F F F F get, F F F F F F promt for studentMark get studentMark Mr.Warawut Chapter 1 Review 32
  • 33. F F F F F+ F (add) F– F (subtract) F* F (multiply) F/ F (divide) F() F / F F F compute calculate divide totalMarks by studentCount salesTax costPrice * 0.10 compute C = (F – 32) * 5 / 9 Mr.Warawut Chapter 1 Review 33
  • 34. F F F F3 1. F initialize F set F F F 2. F F = F F 3. F store F F initialize totalPrice to zero set studentCount to 0 totalPrice = costPrice + salesTax totalPrice costPrice + salesTax store customerId in lastCustomerID Mr.Warawut Chapter 1 Review 34
  • 35. F F F if…then…else F end if if employeeStatus is partTime then add 1 to partTimeCount else add 1 to fullTimeCount end if Mr.Warawut Chapter 1 Review 35
  • 36. F F F dowhile…enddo repeat…until dowhile file_flag <> “eof” read student record print studentName, address to report add 1 to studentTotal enddo eof – End Of File Mr.Warawut Chapter 1 Review 36
  • 37. Mr.Warawut Chapter 1 Review 37
  • 38. The Three Basic Control Structures Sequence Selection Repetition Mr.Warawut Chapter 1 Review 38
  • 39. Sequence Format statement a statement b statement c : : Mr.Warawut Chapter 1 Review 39
  • 40. Example: Sequence add 1 to pageCount print heading line1 print heading line2 set lineCount to zero read customer record Mr.Warawut Chapter 1 Review 40
  • 41. Selection Format if condition p is true then statement(s) in true case else statement(s) in false case end if Mr.Warawut Chapter 1 Review 41
  • 42. Example: Simple IF Statement if accountBalance < 300000 then serviceCharge = 5.00 else serviceCharge = 2.00 end if Mr.Warawut Chapter 1 Review 42
  • 43. Example: Null False Branch if employeeStatus = partTime then add 1 to partTimeCount end if Mr.Warawut Chapter 1 Review 43
  • 44. Example: Combined IF Statement 1 if employeeStatus = partTime and employeeGender = female then add 1 to partTimeCount end if Mr.Warawut Chapter 1 Review 44
  • 45. Example: Combined IF Statement 2 if (recordCode = “23” or updateCode = delete) and accountBalance = zero then delete customer record end if Mr.Warawut Chapter 1 Review 45
  • 46. Example: Combined IF Statement 3 if not (recordCode = “23” and updateCode = delete) then update customer record end if Mr.Warawut Chapter 1 Review 46
  • 47. Example: Nested IF Statement 1 if recordCode = “A” then increment counter_A else if recordCode = “B” then increment counter_B else if recordCode = “C” then increment counter_C else increment errorCounter end if end if end if Mr.Warawut Chapter 1 Review 47
  • 48. Example: Nested IF Statement 2 if employeeStatus = partTime then if employeeGender = female then if employeeAge > 30 then add 1 to matureFemaleEmployee else add 1 to youngFemaleEmployee end if else add 1 to maleEmployee end if else add 1 to fullTimeEmployee end if Mr.Warawut Chapter 1 Review 48
  • 49. Repetition Format dowhile dowhile condition p is true statement block enddo Mr.Warawut Chapter 1 Review 49
  • 50. Repetition Format (Cont.) repeat…until repeat statement statement : : until condition is true Mr.Warawut Chapter 1 Review 50
  • 51. Example: dowhile loop 1 set studentTotal to zero dowhile studentTatal < 50 read student record print studentName, address to report add 1 to studentTotal enddo Mr.Warawut Chapter 1 Review 51
  • 52. Example: dowhile loop 2 Process Student_record set studentCount to zero read student record dowhile studentNumber not equal 999 write student record increment studentCount read student record enddo print studentCount end Mr.Warawut Chapter 1 Review 52
  • 53. Example: repeat…until loop Process Student_record set studentCount to zero repeat read student record if studentNumber not equal 999 write student record increment studentCount end if until studentNumber = 99 print studentCount end Mr.Warawut Chapter 1 Review 53