Lecture Unit 2
Lecture Unit 2
§ Decomposition
§ Pattern recognition
§ Abstraction
§ Algorithms
PROBLEM SOLVING PROCESS TOOLS & STRATEGIES
§ Decomposition : break down complex problems into
smaller, simpler problems.
§ Analysing
§ Designing
§ Implementing
§ Output instructions
§ Mathematical instructions
§ Looping/iterative/Repetitive instructions
FLOWCHARTS, ALGORITHMS & PSEUDOCODE
§ The previous instructions can be represented in a flow
chart using the stand symbols given below:
§ Output or Display
§ Input
§ Process or mathematical
§ Start/Begin or Stop/End
§ Flow line
FLOWCHARTS, ALGORITHMS & PSEUDOCODE
§ Using flowcharts while solving any problem has
following advantages:
§ Effective Communication : Flowchartsare better way of
communicating the logic of the system/program.
§ Efficient
Program Maintenance : Maintenance of operating
programs becomes easy with the help of flowchart.
WHAT ARE ALGORITHMS?
be performed next.
§ It must be composed of a finite number of steps.
§ It must terminate.
used)
WHY ARE ALGORITHMS IMPORTANT?
§ At the foundation of most of the computing
problem are algorithms.
If …. else
Statement
WRITING AN ALGORITHM
dividing by number of Ms
§ STEP 4: If the average is greater or equal to 50 print “PASS”
Without
Repeat
Statement
But If statement
only
WRITING AN ALGORITHM
dividing by number of Ms
§ STEP 4: If the average is greater or equal to 50 print “PASS”
WRITING PSEUDOCODE
§ Pseudocode:
Input M1,M2,M3,M4
GRADE = (M1+M2+M3+M4)/4
if (GRADE < 50) then
Print “FAIL”
endif
WRITING AN ALGORITHM
With Repeat
Statement
But, If statement
only
WRITING AN ALGORITHM
dividing by number of Ms
§ STEP 4: If the average is greater or equal to 50 print “PASS”
Perlongs Computing
41