Web & Social Media Analytics Previous Year Question Paper.pdf
การพัฒนาซอฟต์แวร์และวิเคราะห์การแก้ปัญหา
1. Chapter 1
Software Development and
Analysis 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 and
Mr.Warawut Khangkhan Analysis of the Problem 3
4. 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 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. F
Chapter 1 Software Development and Analysis of the Problem
Mr.Warawut Khangkhan 14
15. F
F2
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 15
16. F F
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 16
17. F F
1. F F
2. FF
3. 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 F
F
F F-
F F - F F
F F
2
F F - F F F
F
= +
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 24
25. F F F
F
1. F F-
2. F F - F F F F
F FF F
F F F
area = ½ x base x height
3. F F - F F
F F
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 25
26. Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 26
27. Algorithm
F F F F
F
F F F
F F
F F F F F
F
Chapter 1 Software Development and Analysis of the Problem
Mr.Warawut Khangkhan 27
28. 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
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 28
29. Algorithm
Algorithm < >
1. ……………..
2. ……………..
3. …………….
END
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 29
30. Example Algorithm
F
1.
2. F F
3. F
4.
5. F
6.
7. 3
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 30
31. Example Algorithm (Cont.)
Algorithm F
1. F F F
2. F 1 F
3. F F
4. F F
5. F F F F F F F
6.
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 31
32. Example Algorithm (Cont.)
Algorithm
1. F ( F )
F
2. F
3. F F F
4. F F F
5. F F F
6.
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 32
33. Example Algorithm (Cont.)
Algorithm
1. F
2. F 2 F
3. F 2 F
4. F 2 F
5. F F ¾ F
6. F F
7.
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 33
34. Example Algorithm (Cont.)
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
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. 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
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 37
38. F (Cont.)
4. F F F
F F
5. 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 F
2. F F F
3. F F
4. F F F
5. F
F
6. 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 F
read studentName
get systemDate
read number1, number2
get 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 F
print “Program Completed”
write customer record to master file
put name, address and postcode
output totalTax
display “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 F
F F F
promt for studentMark
get 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 compute
calculate
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 45
46. F F F
divide totalMarks by studentCount
salesTax costPrice * 0.10
compute C = (F – 32) * 5 / 9
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 46
47. F F F
F3
1. F initialize F set F
F F
2. F F =
F F
3. F store F F
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 47
48. F F F
F
initialize totalPrice to zero
set studentCount to 0
totalPrice = costPrice + salesTax
totalPrice costPrice + salesTax
store 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 if
if employeeStatus is partTime then
add 1 to partTimeCount
else
add 1 to fullTimeCount
end if
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 49
50. 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
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
53. F
add 1 to pageCount
print heading line1
print heading line2
set lineCount to zero
read 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 case
else
statement(s) in false case
end 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.00
else
serviceCharge = 2.00
end 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 partTimeCount
end 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 record
end 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 record
end 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_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
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 if
else
add 1 to fullTimeEmployee
end if
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 61
64. F dowhile loop 1
set studentTotal to zero
dowhile studentTatal < 50
read student record
print studentName, address to
report
add 1 to studentTotal
enddo
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 64
65. F 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 Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 65
66. F 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 Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 66
end
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. F
1. F F F
F
2. F
3. 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 and
Mr.Warawut Khangkhan Analysis of the Problem 71
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 F
2. F F
F F
3. Flowchart F F
F
4. 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 F
6. 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
F
F
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 82
83. F
Algorithm
1. F F F base
height
2. (area)
area = 0.5 * base * height
3. (area)
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 83
84. F
Algorithm
get base, height
compute area = 0.5 * base * height
display 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. F
Algorithm F F salary tax
1. F (Salary)
2. tax = salary * 0.1
3.
---------------------------------
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) F
F 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 F
100 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 > 49
Display 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 and
Mr.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
N
I <= 10
Y
Display I
N=N+I
Stop
I=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+1
Y N Display I Stop
I <= 10
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 101
102. F
F F
F F F F
F F
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 102
103. F
Algorithm F F 0 4
1. I F F 0
2. 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. F
Algorithm F F 0 4
set i to 0
dowhile i <= 4 then
print i
add 1 to i
enddo
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 104
105. Start
I = 0
N
I <= 4
Y
Stop
Print I
I = I + 1
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 105
106. Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 106
107. F F F
F 1 F F
Do while
F
F
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 107
108. Chapter 1 Software Development and
Mr.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 F
2. F F F
F 1 – 50
3. F 2. F , F
F F
Chapter 1 Software Development and
Mr.Warawut Khangkhan Analysis of the Problem 110