Your SlideShare is downloading. ×
  • Like
การพัฒนาซอฟต์แวร์และวิเคราะห์การแก้ปัญหา
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

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

  • 418 views
Published

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

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

Published in Education
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
418
On SlideShare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
17
Comments
0
Likes
1

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 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. Contents F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 2
  • 3. F Chapter 1 Software Development andMr.Warawut Khangkhan Analysis of the Problem 3
  • 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. (STEPS IN PROGRAM DEVELOPMENT) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 5
  • 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. 1.(Define the Problem) Inputs Outputs Processing Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 7
  • 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. 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. 4. F(Test the Algorithm for Correctness) F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 10
  • 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. 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. 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. FChapter 1 Software Development and Analysis of the Problem Mr.Warawut Khangkhan 14
  • 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. F F Chapter 1 Software Development andMr.Warawut Khangkhan Analysis of the Problem 16
  • 17. F F1. F F2. FF3. F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 17
  • 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. 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. 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. 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. 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. 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. 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. 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. Chapter 1 Software Development andMr.Warawut Khangkhan Analysis of the Problem 26
  • 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. 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. AlgorithmAlgorithm < >1. ……………..2. ……………..3. …………….END Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 29
  • 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. 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. 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. 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. 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. (Cont.) 2 (Pseudo Code) (Flowchart) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 35
  • 36. Pseudo Code F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 36
  • 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. 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. 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. 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. F F F Fread studentNameget systemDateread number1, number2get taxCode Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 41
  • 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. 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. 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. 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. 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. 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. 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. 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. 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. F 3(The Three Basic Control Structures) (Sequence) (Selection) (Repetition) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 51
  • 52. (Sequence Format)statement astatement bstatement c : : Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 52
  • 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. (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. 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. 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. 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. 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. 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. 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. 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. (Repetition Format)dowhiledowhile condition p is true statement blockenddo Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 62
  • 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. 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. 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. 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. (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. F1. F F F F2. F3. F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 68
  • 69. F 2 F(System Flowchart) (Program Flowchart) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 69
  • 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. Chapter 1 Software Development andMr.Warawut Khangkhan Analysis of the Problem 71
  • 72. Mr.Warawut Khangkhan 72
  • 73. (Program Flowchart) FF F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 73
  • 74. Mr.Warawut Khangkhan 74
  • 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. 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. 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. 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. 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. (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. (Sequence) (Selection)(Repetition) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 81
  • 82. F F FF Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 82
  • 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. FAlgorithmget base, heightcompute area = 0.5 * base * heightdisplay area Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 84
  • 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. 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. 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. 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. Workshop: F Y = 2X * 2 Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 89
  • 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. (Cont.) Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 91
  • 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. 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. (Cont.) F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 94
  • 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. 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. 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. F F F F(True) (False) F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 98
  • 99. ( F) Chapter 1 Software Development andMr.Warawut Khangkhan Analysis of the Problem 99
  • 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. (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. F F FF F F F F F Chapter 1 Software Development and Mr.Warawut Khangkhan Analysis of the Problem 102
  • 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. 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. 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. Chapter 1 Software Development andMr.Warawut Khangkhan Analysis of the Problem 106
  • 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. Chapter 1 Software Development andMr.Warawut Khangkhan Analysis of the Problem 108
  • 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. 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