Professional Documents
Culture Documents
Chapter 1
Chapter 1
PROBLEM SOLVING
(CSC415)
by
AFIZA ISMAIL
Faculty of Computer & Mathematical Sciences
UiTM SHAH ALAM
Introduction
Chapter One
Contents
Basic Concept
Program Development Process
Program Control Structure
Storage Example
(Input) (Output)
Direction
Input/Output Operation
Example
Read Speed
Read Length
False
Speed > 1100
True
False
Length > 52
Classification = “Aircraft Type Unknown”
True Classification = “Military”
Classification = “Civilian”
Display classification
End
Statement 1
Statement 2
Statement n
End
Read Number1,
Number2
Compute Total
Compute Average
Print Total
and Average
End
FALSE
Condition
TRUE
Statement (s)
End
Read Score
FALSE
Score >= 50
TRUE
Status is “Passed”
End
FALSE
Condition
TRUE
End
Read Score
FALSE
Score >= 50
TRUE
End
Read Score
FALSE
Score >= 50
TRUE
End
FALSE
Condition 1
TRUE FALSE
Condition 2
Statement (s)
TRUE FALSE
Condition n
Statement (s)
TRUE
End
FALSE
code = ‘M’
TRUE FALSE
code = ‘F’
gender is “Male”
TRUE
End
Initialize counter
False
Test
update counter
count = 0
False
count < 5
True
exit loop
Read a
number
Count + 1
False
Test
Sentinel value
True
Statement(s)
Exit loop
False
Score <> 999?
Read Score
Number1 [ 40 ]
Number2 [ 30 ]
Total [70 ]
Back
Begin
Read two
numbers
Calculate Total
Print Total
Back
End
return 0;
}//end main() Back