Problem Analysis

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 25

 Problem Analysis

 Coding
 Debugging
 Testing
 In Problem Analysis phase, the internal logic
of the program is planned.
 Various program analysis techniques are
used to represent the logic of the program.
 Flowcharts, pseudo codes, algorithms and
decision tables are mainly used tools for
this purpose.
 The Problem Analysis phase finds the most
efficient method of developing a program.
 After developing the desired logic and
sequence of steps, to develop a program, the
developers reach at the coding stage.
 In the coding stage, a programming language
like C,C++ is selected and the program
instructions are coded as per the syntax os
the chosen language.
 The process of removing all kinds of errors in the
program is called as debugging.
 After removing all the errors from the
program, it is executed and supplied with
valid input to see whether the program
returns the accurate output after taking
accurate input.
 Before starting the development of a
program, its logical working is generally
implemented, by using various analysis tools
like Flowcharts, Algorithms, Pseudo codes
and Decision Tables.
 These tools depict the step by step working
of the program and help the analyst to chose
a particular logic or sequence of instructions.
 A module consists of a series of program
instructions or statements in some
programming language.
 A module as a whole has a unique name.
 A module has only one entry point called
main() function.
 Algorithm
 Flowcharts
 Pseudo Codes
 Decision Table
 It can be defined as sequence of instructions
to be carried out in order to solve a problem.
 Algorithms are written in general English
language.
 These are independent of any programming
language.
 A problem may have multiple algorithms.
 It makes the program easy to read and
understand.
 It makes the program portable and efficient.
 It displays easy steps of processing.
 It simplifies the modification and updation of
the existing program.
 It provides the facility for testing a program
at developing stage.
 Step 1. Start
Step 2. Let a=10, b=20
Step 3. c=a+b
Step 4. Print c
Step 5. Stop
 The graphical representation of algorithm is
called flowchart.
 It is also called as symbolic diagrams of
operations and the sequence, data flow,
control flow and processing logic in
information processing.
Terminal
Input/Output
Processing
Decision
Flow Line
Flow chart to input marks of a student in three subjects and print the total
marks

START

SUM=0
M1=0
M2=0
M3=0

INPUT
MARKS OF
THREE
SUBJECTS

SUM=M1+M2+M3

PRINT
SUM

STOP
 It represents the data flow.
 It provides a clear overview of the entire
program and problem and solution.
 It documents the steps followed in an
algorithm.
 It provides the facility for coding.
 It shows all major elements and their
relationship.
 Flowcharts are time consuming.
 It is difficult to draw with proper symbols
and spacing.
 Little modification in flowchart needs to
redraw the whole flowchart.
 There is no standard for explaining the depth
of detail that should be included in
flowchart.
 A decision table is a tabular form that
presents a set of conditions and their
corresponding actions.
 Condition Stubs
It describes the conditions or factors that
will affect the decision or policy.
 Action Stubs
These are describes in form of statements.
TABLE HEADING DECISION RULES

CONDITION CONDITION STUB


ENTRIES

ACTION ENTRIES ACTION STUB


 The decision tables are easier to draw and
modify than flow charts.
 They provide short and compact
documentation.
 It is easier to analyze the steps , which
would be followed, when a set of condition is
true than a flow chart.
 It takes more time to understand the
problem through decision table than a flow
chart.
 It is unable to demonstrate the sequence of
steps as shown by flow charts.
 Pseudo is a way of describing an algorithm
without using any specific programming
language.
 Pseudo codes uses simple English language to
express the logic and flow of the program.
 It has no graphical or tabular syntax.
1) Sequence logic
It is used for expressing the sequence of
execution of instruction using top to bottom
approach.
2) Selection Logic
To take decision in the program.
3) Iteration
To repeat the execution of a set of
instructions.
Set COUNT ADULT CHILD to 0
DO WHILE COUNT is not equal to 1000
Read the age of the person
IF AGE>=18 THEN
Add 1 to CHILD
ENDIF
Add 1 to COUNT
ENDDO
Write ADULT CHILD
STOP
 It is very easy to convert a pseudo code into
program of actual computer language.
 Pseudo codes are relatively easy to modify in
case of change in the logic of program.
 Pseudo codes are relatively less time
consuming than a flow chart.
 No graphical representation is available with
pseudo codes.
 There are no standard rules to follow in using
pseudo codes.
 Pseudo code is difficult to understand foe
beginner.

You might also like