Professional Documents
Culture Documents
Program Design Tools: Algorithms, Flow Charts, Pseudo Codes and Decision Tables
Program Design Tools: Algorithms, Flow Charts, Pseudo Codes and Decision Tables
Program Design Tools: Algorithms, Flow Charts, Pseudo Codes and Decision Tables
» Sequence
» Selection (If … then … Endif, If … then … Else … Endif)
» Iteration (For … Endfor, While … Endwhile, Do … While)
instruction -1 Instruction -2
instruction -2
instruction -3 Instruction -3
:
expression true
:
If ( expression ) then false
statement
Endif statement
:
:
:
• It uses an index variable k to control the loop. k
: false
expression
:
While ( expression ) do
true
statement statement
Endwhile
:
:
:
statement
:
Do
true
statement expression
– The first part, which is optional, describes the input data, the purpose
of the algorithm and identifies the variables used in the pseudo-code.
ax2 + bx + c = 0 provided a ≠0
Condition
Condition
Entries
Stub
C2 Condition Row
.
.
Ck
A1
Action
Entries
Action
A2 Action Row
Stub
.
.
Am Designed by Parul Khurana, LIECA.
Decision-Table
• The part above horizontal double lines pertains to
the conditions being listed, i.e., questions being
asked and, the outcomes of these tests, i.e., the
answers to these questions.
– If the depositor’s age is under 21 and if the deposit is below Rs. 1000/-
, do not open the account.
Construct a limited entry decision table corresponding to the verbal
statement given above to classify a new account.
Designed by Parul Khurana, LIECA.
Example- Decision-Table - Solution
• In order to obtain a decision table, first separate, from each sentence,
parts that specify conditions, and another part that specify a specific
actions that are to be performed based on the results obtained by testing
these conditions. For the above problem, the relevant condition clauses
and actions are separated and marked as shown below: