Chapter 1Software Development andAnalysis of the Problem                             Mr.Warawut Khangkhan                T...
Contents                                               F                   F           F             F                    ...
F                       Chapter 1 Software Development andMr.Warawut Khangkhan   Analysis of the Problem                  3
F                                                           F                  F        F F                               ...
(STEPS IN PROGRAM DEVELOPMENT)                              Chapter 1 Software Development and       Mr.Warawut Khangkhan ...
1.                  (Define the Problem)2.    F                             F           (Outline the     Solution)3.      ...
1.(Define the Problem)  Inputs  Outputs  Processing                                    Chapter 1 Software Development and ...
2. F                                                              F(Outline the Solution)                F                ...
3.(Develop and Algorithm)         F                                                    F     F (Pseudo Code)      F F     ...
4.                       F(Test the Algorithm for Correctness)     F        F                                   F         ...
5.(Programming)           F            F      F   F             (    )       F        (High Language)             F C, PAS...
6.(Testing)      F     F    F     F   F                  F     ◦        (Syntax Errors)     ◦    (Logic Errors)     F     ...
7.(Document and Maintain the Program)                                           F                   F                     ...
FChapter 1 Software Development and Analysis of the Problem                                                         Mr.War...
F                                                   F2                                      F                     F       ...
F               F                       Chapter 1 Software Development andMr.Warawut Khangkhan   Analysis of the Problem  ...
F              F1.   F               F2.   FF3.   F                              F         F                              ...
1.                     F                  F         F                 F F             F                    F              ...
2.                 FF       F       F                        F             F                        F                     ...
F             F                    F    F   F            F a = 20 b = 15 c = 5                 10              F          ...
F                       F F F                          F           F                     F       F                        ...
F    F F            F                                            F       F                                                ...
3.               F                                        F     F                         F                      F        ...
F                                F                FF        F         F-        F F   -          F                    F   ...
F                                 F              F     F1.                F             F-2.                F F       -   ...
Chapter 1 Software Development andMr.Warawut Khangkhan   Analysis of the Problem              26
Algorithm                      F                                                     F           F       F                ...
F         F1.           F       F                    F           F                F        F2.           F                ...
AlgorithmAlgorithm <                       >1. ……………..2. ……………..3. …………….END                                Chapter 1 Soft...
Example Algorithm             F1.2.   F           F3.                             F4.5.       F6.7.           3           ...
Example Algorithm (Cont.)Algorithm F1.      F   F                                                                        F...
Example Algorithm (Cont.)Algorithm1.  F   (                          F                  )                                 ...
Example Algorithm (Cont.)Algorithm1.              F2.   F                      2 F3.     F 2 F4.      F         2 F5.     ...
Example Algorithm (Cont.)                 Fturn on calculatorclear calculatorrepeat the following instructions    key in b...
(Cont.)                 2        (Pseudo Code)     (Flowchart)                                 Chapter 1 Software Developm...
Pseudo Code     F             F         F                                                                   F             ...
F1.   F                       (Statement) F                                        F                                F F2. ...
F (Cont.)4.       F                       F                                          F                 F                  ...
6                                                            F(Six Basic Computer Operations)1.       F                F  ...
F                                         F                     F         F                   F               (           ...
F              F                         F              Fread studentNameget systemDateread number1, number2get taxCode   ...
F                                             F F              F F                          print, write, put,output      ...
F               F                                             F Fprint “Program Completed”write customer record to master ...
F                                         F F (Cont.)    prompt             F                    F              F         ...
F                                    F        F       F◦           F+ F                      (add)◦           F– F        ...
F                F                                       Fdivide totalMarks by studentCountsalesTax costPrice * 0.10comput...
F                                 F                      F                     F31.   F                initialize         ...
F               F                                    F Finitialize totalPrice to zeroset studentCount to 0totalPrice = cos...
F     F F if…then…else                              F      end ifif employeeStatus is partTime then    add 1 to partTimeCo...
F                                        F      F dowhile…enddo    repeat…untildowhile file_flag <> “eof”   read student r...
F                                3(The Three Basic Control Structures)            (Sequence)                (Selection)   ...
(Sequence Format)statement astatement bstatement c    :    :                                     Chapter 1 Software Develo...
Fadd 1 to pageCountprint heading line1print heading line2set lineCount to zeroread customer record                        ...
(Selection Format)if condition p is true then    statement(s) in true caseelse    statement(s) in false caseend if        ...
F(Simple IF Statement)if accountBalance < 300000 then    serviceCharge = 5.00else    serviceCharge = 2.00end if           ...
F(Null False Branch) if employeeStatus = partTime then     add 1 to partTimeCount end if                                  ...
F(Combined IF Statement 1)if employeeStatus = partTime    and employeeGender = female then       add 1 to partTimeCountend...
F(Combined IF Statement 2)if (recordCode = “23” or updateCode  = delete)    and accountBalance = zero then       delete cu...
F(Combined IF Statement 3)if not (recordCode = “23”    and updateCode = delete) then       update customer recordend if   ...
F(Nested IF Statement 1)if recordCode = “A” then    increment counter_Aelse    if recordCode = “B” then        increment c...
F(Nested IF Statement 2)if employeeStatus = partTime then    if employeeGender = female then        if employeeAge > 30 th...
(Repetition Format)dowhiledowhile condition p is true   statement blockenddo                                  Chapter 1 So...
(Repetition Format) (Cont.)repeat…untilrepeat   statement   statement       :       :until condition is true              ...
F dowhile loop 1set studentTotal to zerodowhile studentTatal < 50   read student record   print studentName, address to re...
F dowhile loop 2Process Student_record   set studentCount to zero   read student record   dowhile studentNumber not equal ...
F repeat … until loopProcess Student_record   set studentCount to zero   repeat       read student record       if student...
(Flowchart)         F                 F               F                   F F                                 F           ...
F1.       F                                   F                        F     F2.                                          ...
F     2        F(System Flowchart)  (Program Flowchart)                         Chapter 1 Software Development and  Mr.War...
(System Flowchart)F        F       F            F                   F                      F            F                 ...
Chapter 1 Software Development andMr.Warawut Khangkhan   Analysis of the Problem              71
Mr.Warawut Khangkhan   72
(Program Flowchart)                               FF                                  F    F                              ...
Mr.Warawut Khangkhan   74
F    Terminal                                              F START       STOP F                                       F F ...
F                  (Cont.)    Process      F                                -    F           F    Decision                ...
F               (Cont.)    Preparation (          ) F                                        F         F                  ...
F                  (Cont.)    Connector F                      F    F          F                                 F        ...
1.       F               F       F                                                   F2.                   F              ...
(Cont.)5.                    F        F F                            F                   F              F            F    ...
(Sequence)    (Selection)(Repetition)                        Chapter 1 Software Development and Mr.Warawut Khangkhan   Ana...
F        F            FF                                       Chapter 1 Software Development and                Mr.Warawu...
FAlgorithm1. F           F   F      base   height2.                   (area)   area = 0.5 * base * height3.               ...
FAlgorithmget base, heightcompute area = 0.5 * base * heightdisplay area                                   Chapter 1 Softw...
F              Start        base, height    area = 0.5 * base * height                 area                 Stop          ...
F    F F F   F       (salary) F             (tax) 10% F      F F salary tax                                   Chapter 1 So...
FAlgorithm      F F salary tax1. F         (Salary)2.                   tax = salary * 0.13.------------------------------...
F         Start        salary    tax = salary * 0.1    print salary, tax          Stop                                 Cha...
Workshop:                   F                      Y = 2X * 2                                   Chapter 1 Software Develop...
F            F           F                F                    F    F   F F     (True)      (False) FF   F               F...
(Cont.)                                 Chapter 1 Software Development and          Mr.Warawut Khangkhan   Analysis of the...
Workshop:                                                                F                            F100 F              ...
Workshop:                                                                                 F                   2 F         ...
(Cont.)                                                          F      F                                 Chapter 1 Softwa...
(Cont.)    Start                                                                      1 name, score                       ...
Workshop:                                                                       F                                         ...
Workshop:                                           F                                                                     ...
F                                                               F                   F                             F(True) ...
( F)                       Chapter 1 Software Development andMr.Warawut Khangkhan   Analysis of the Problem              99
(Cont.) Start                N=?                        N = 55                      I=?                        I = 11 N=0 ...
(Cont.)     Start     N=0     I=1    N=N+I    I=I+1Y             N         Display I                   Stop    I <= 10    ...
F                   F FF       F                                       F F                           F F                  ...
FAlgorithm F F 0 41.          I F F 02.            I   2.1 F I <= 4 F             F F I         I=I+1(      F F           ...
FAlgorithm F F 0                        4set i to 0dowhile i <= 4 then    print i    add 1 to ienddo                      ...
Start  I = 0                   N I <= 4  Y                                     Stop Print II = I + 1                      ...
Chapter 1 Software Development andMr.Warawut Khangkhan   Analysis of the Problem              106
F                F F F 1     F                                                          FDo while                         ...
Chapter 1 Software Development andMr.Warawut Khangkhan   Analysis of the Problem              108
Workshop:                           F                               1-10                        F                         ...
Homework:1.                      F                            F                   F     F          F           F         F...
Upcoming SlideShare
Loading in …5
×

การพัฒนาซอฟต์แวร์และวิเคราะห์การแก้ปัญหา

628 views

Published on

การพัฒนาซอฟต์แวร์และวิเคราะห์การแ้ก้ปัญหา

Published in: Education
  • Be the first to comment

การพัฒนาซอฟต์แวร์และวิเคราะห์การแก้ปัญหา

  1. 1. Chapter 1Software Development andAnalysis of the Problem Mr.Warawut Khangkhan Twitter: http://twitter.com/awarawut Facebook: http://www.facebook.com/AjWarawut E-Mail: awarawut@hotmail.com Mobile: 083-0698-410
  2. 2. Contents F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 2
  3. 3. F Chapter 1 Software Development andMr.Warawut Khangkhan Analysis of the Problem 3
  4. 4. F F F F F F F F F FF F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 4
  5. 5. (STEPS IN PROGRAM DEVELOPMENT) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 5
  6. 6. 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 Khangkhan Chapter 1 Software Development and Analysis of the Problem 6
  7. 7. 1.(Define the Problem) Inputs Outputs Processing Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 7
  8. 8. 2. F F(Outline the Solution) F F ( ) F F F F ◦ F ◦ F F F (Subtask) ◦ F F F F ◦ F F F ◦ F F ◦ (Logic) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 8
  9. 9. 3.(Develop and Algorithm) F F F (Pseudo Code) F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 9
  10. 10. 4. F(Test the Algorithm for Correctness) F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 10
  11. 11. 5.(Programming) F F F F ( ) F (High Language) F C, PASCAL F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 11
  12. 12. 6.(Testing) F F F F F F ◦ (Syntax Errors) ◦ (Logic Errors) F F F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 12
  13. 13. 7.(Document and Maintain the Program) F F F F F ◦ (External Document) F F F F F ◦ (Internal Document) F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 13
  14. 14. FChapter 1 Software Development and Analysis of the Problem Mr.Warawut Khangkhan 14
  15. 15. F F2 F F F F FF F F F F F F F F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 15
  16. 16. F F Chapter 1 Software Development andMr.Warawut Khangkhan Analysis of the Problem 16
  17. 17. F F1. F F2. FF3. F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 17
  18. 18. 1. F F F F F F F F F ( F F F F F F ) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 18
  19. 19. 2. FF F F F F F F F3 ◦ F F F ◦ F F F F ◦ F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 19
  20. 20. F F F F F F a = 20 b = 15 c = 5 10 F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 20
  21. 21. F F F F F F F F F F F F n F F F F F F F 2 F F F F F F 2 Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 21
  22. 22. F F F F F F F F F F F F F F F F F F F (Base) (Height) ½ 0.5 F (Constant) F F F F = ½ x base x height Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 22
  23. 23. 3. F F F F F F F F F F F F FF F F F FF F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 23
  24. 24. F F FF F F- F F - F F F F2 F F - F F F F = + Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 24
  25. 25. F F F F1. F F-2. F F - F F F F F FF F F F F area = ½ x base x height3. F F - F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 25
  26. 26. Chapter 1 Software Development andMr.Warawut Khangkhan Analysis of the Problem 26
  27. 27. Algorithm F F F F F F F F F F F F F F F FChapter 1 Software Development and Analysis of the Problem Mr.Warawut Khangkhan 27
  28. 28. F F1. F F F F F F2. F F F F F F3. F F F F F F4. F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 28
  29. 29. AlgorithmAlgorithm < >1. ……………..2. ……………..3. …………….END Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 29
  30. 30. Example Algorithm F1.2. F F3. F4.5. F6.7. 3 Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 30
  31. 31. Example Algorithm (Cont.)Algorithm F1. F F F2. F 1 F3. F F4. F F5. F F F F F F F6. Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 31
  32. 32. Example Algorithm (Cont.)Algorithm1. F ( F ) F2. F3. F F F4. F F F5. F F F6. Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 32
  33. 33. Example Algorithm (Cont.)Algorithm1. F2. F 2 F3. F 2 F4. F 2 F5. F F ¾ F6. F F7. Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 33
  34. 34. Example Algorithm (Cont.) Fturn on calculatorclear calculatorrepeat the following instructions key in baht amount key in decimal point (.) key in satang amount press addition(+) keyuntil all prices have been enteredwrite down total priceturn off calculator Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 34
  35. 35. (Cont.) 2 (Pseudo Code) (Flowchart) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 35
  36. 36. Pseudo Code F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 36
  37. 37. F1. F (Statement) F F F F2. F3. F F F F F (Keywords) F F F F F F FF F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 37
  38. 38. F (Cont.)4. F F F F F5. F F F F F F F F F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 38
  39. 39. 6 F(Six Basic Computer Operations)1. F F F2. F F F3. F F4. F F F5. F F6. F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 39
  40. 40. F F F F F ( ) F F F F F F FF F F F F F F F F F F F F F F F F read get F F◦ read F F F FF◦ get F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 40
  41. 41. F F F Fread studentNameget systemDateread number1, number2get taxCode Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 41
  42. 42. 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 Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 42
  43. 43. F F F Fprint “Program Completed”write customer record to master fileput name, address and postcodeoutput totalTaxdisplay “End of data” Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 43
  44. 44. F F F (Cont.) prompt F F F F get, F F FF F Fpromt for studentMarkget studentMark Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 44
  45. 45. F F F F◦ F+ F (add)◦ F– F (subtract)◦ F* F (multiply)◦ F/ F (divide)◦ F() F / F F F computecalculate Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 45
  46. 46. F F Fdivide totalMarks by studentCountsalesTax costPrice * 0.10compute C = (F – 32) * 5 / 9 Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 46
  47. 47. F F F F31. F initialize F set F F F2. F F = F F3. F store F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 47
  48. 48. F F F Finitialize totalPrice to zeroset studentCount to 0totalPrice = costPrice + salesTaxtotalPrice costPrice + salesTaxstore customerId in lastCustomerID Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 48
  49. 49. F F F if…then…else F end ifif employeeStatus is partTime then add 1 to partTimeCountelse add 1 to fullTimeCountend if Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 49
  50. 50. F F F dowhile…enddo repeat…untildowhile file_flag <> “eof” read student record print studentName, address to report add 1 to studentTotalenddoeof – End Of File Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 50
  51. 51. F 3(The Three Basic Control Structures) (Sequence) (Selection) (Repetition) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 51
  52. 52. (Sequence Format)statement astatement bstatement c : : Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 52
  53. 53. Fadd 1 to pageCountprint heading line1print heading line2set lineCount to zeroread customer record Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 53
  54. 54. (Selection Format)if condition p is true then statement(s) in true caseelse statement(s) in false caseend if Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 54
  55. 55. F(Simple IF Statement)if accountBalance < 300000 then serviceCharge = 5.00else serviceCharge = 2.00end if Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 55
  56. 56. F(Null False Branch) if employeeStatus = partTime then add 1 to partTimeCount end if Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 56
  57. 57. F(Combined IF Statement 1)if employeeStatus = partTime and employeeGender = female then add 1 to partTimeCountend if Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 57
  58. 58. F(Combined IF Statement 2)if (recordCode = “23” or updateCode = delete) and accountBalance = zero then delete customer recordend if Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 58
  59. 59. F(Combined IF Statement 3)if not (recordCode = “23” and updateCode = delete) then update customer recordend if Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 59
  60. 60. F(Nested IF Statement 1)if recordCode = “A” then increment counter_Aelse if recordCode = “B” then increment counter_B else if recordCode = “C” then increment counter_C else increment errorCounter end if end ifend if Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 60
  61. 61. F(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 ifelse add 1 to fullTimeEmployeeend if Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 61
  62. 62. (Repetition Format)dowhiledowhile condition p is true statement blockenddo Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 62
  63. 63. (Repetition Format) (Cont.)repeat…untilrepeat statement statement : :until condition is true Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 63
  64. 64. F dowhile loop 1set studentTotal to zerodowhile studentTatal < 50 read student record print studentName, address to report add 1 to studentTotalenddo Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 64
  65. 65. F dowhile loop 2Process Student_record set studentCount to zero read student record dowhile studentNumber not equal 999 write student record increment studentCount read student record enddo print studentCountend Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 65
  66. 66. F repeat … until loopProcess 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 Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 66end
  67. 67. (Flowchart) F F F F F F F F F F F FF F F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 67
  68. 68. F1. F F F F2. F3. F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 68
  69. 69. F 2 F(System Flowchart) (Program Flowchart) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 69
  70. 70. (System Flowchart)F F F F F F F F F F F F F F F F F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 70
  71. 71. Chapter 1 Software Development andMr.Warawut Khangkhan Analysis of the Problem 71
  72. 72. Mr.Warawut Khangkhan 72
  73. 73. (Program Flowchart) FF F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 73
  74. 74. Mr.Warawut Khangkhan 74
  75. 75. F Terminal F START STOP F F F Manual Input F F F F F Monitor (Output) F F F F Input/Output Data F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 75
  76. 76. F (Cont.) Process F - F F Decision F F F 2 (True) (False) (?) F F F Magnetic Disk F F F F Comment F F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 76
  77. 77. F (Cont.) Preparation ( ) F F F F F Sobroutine processing ( F F ) F F F F F F Document ( ) / F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 77
  78. 78. F (Cont.) Connector F F F F F F F Off-Page Connector F F F F F Flow Direction Lines ( F ) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 78
  79. 79. 1. F F F F2. F F F F3. Flowchart F F F4. Flowchart F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 79
  80. 80. (Cont.)5. F F F F F F F F F6. F Flowchart F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 80
  81. 81. (Sequence) (Selection)(Repetition) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 81
  82. 82. F F FF Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 82
  83. 83. FAlgorithm1. F F F base height2. (area) area = 0.5 * base * height3. (area) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 83
  84. 84. FAlgorithmget base, heightcompute area = 0.5 * base * heightdisplay area Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 84
  85. 85. F Start base, height area = 0.5 * base * height area Stop Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 85
  86. 86. F F F F F (salary) F (tax) 10% F F F salary tax Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 86
  87. 87. FAlgorithm F F salary tax1. F (Salary)2. tax = salary * 0.13.--------------------------------- get salary compute tax = salary * 0.1 display salary, tax Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 87
  88. 88. F Start salary tax = salary * 0.1 print salary, tax Stop Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 88
  89. 89. Workshop: F Y = 2X * 2 Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 89
  90. 90. F F F F F F F F (True) (False) FF F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 90
  91. 91. (Cont.) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 91
  92. 92. Workshop: F F100 F F F F 100 F F F F F 100 F F F F F 100 F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 92
  93. 93. Workshop: F 2 F F F F F F F F F F F F F F F F F FF F F F F F F F F F F F F F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 93
  94. 94. (Cont.) F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 94
  95. 95. (Cont.) Start 1 name, score Stop score > 0 Y N Y N score > 49Display Error Display Pass Display Not Pass 1 1 1 Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 95
  96. 96. Workshop: F F 2 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 F F F F F F F F F F F F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 96
  97. 97. Workshop: F F 80 100 A 70 79 B 60 69 C 50 59 D 0 49 F F F F F F F F , F F F F F 0 100 F F F F Out of range 97
  98. 98. F F F F(True) (False) F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 98
  99. 99. ( F) Chapter 1 Software Development andMr.Warawut Khangkhan Analysis of the Problem 99
  100. 100. (Cont.) Start N=? N = 55 I=? I = 11 N=0 I=1 N=? N = 15 I=5 I=5 NI <= 10 Y Display IN=N+I StopI=I+1 Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 100
  101. 101. (Cont.) Start N=0 I=1 N=N+I I=I+1Y N Display I Stop I <= 10 Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 101
  102. 102. F F FF F F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 102
  103. 103. FAlgorithm F F 0 41. I F F 02. I 2.1 F I <= 4 F F F I I=I+1( F F I 1) 2 2.2 F I > 4 F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 103
  104. 104. FAlgorithm F F 0 4set i to 0dowhile i <= 4 then print i add 1 to ienddo Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 104
  105. 105. Start I = 0 N I <= 4 Y Stop Print II = I + 1 Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 105
  106. 106. Chapter 1 Software Development andMr.Warawut Khangkhan Analysis of the Problem 106
  107. 107. F F F F 1 F FDo while F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 107
  108. 108. Chapter 1 Software Development andMr.Warawut Khangkhan Analysis of the Problem 108
  109. 109. Workshop: F 1-10 F F F F F 1- 10 F F F F F F F F F F F 2 – 12 F F F F Error” Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 109
  110. 110. Homework:1. F F F F F F F F2. F F F F 1 – 503. F 2. F , F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 110

×