Académique Documents
Professionnel Documents
Culture Documents
Program design
Topic & Structure of the lesson
• Problem Solving
• Algorithm
• Pseudocodes
• Flowcharts
Algorithm
Pseudocode
Flowchart
DEVISING A PLAN
Second: Have you seen it before? Or have you
Find the connection seen the same problem in slightly different
between the data and form?
the unknown. Do you know a related problem?
Auxiliary problems Look at the unknown! Try to think of a
may be devised if familiar problem having the same or similar
needed. unknown. Split the problem into smaller,
You should obtain simple sub-problems. If you cannot solve
eventually a plan of the proposed problem try to solve first
the solution. some related problem. Or solve more
general problem. Or special case of the
problem. Or solve the part of the problem.
Examine the Can you check the result? Can you derive
solution the result differently? Can you use the
obtained. result, or the method, for some other
problem?
Algorithmic problem:
Any problem whose solution can be
expressed as a set of executable instructions.
Algorithm:
A well defined computational procedure
consisting of a set of instructions, that takes
some value or set of values, as input, and
produces some value or set of values, as
output.
CT018-3-1 Introduction To C Programming Program Design
Characteristics of an Algorithm
Value1 Sum
Value2
+ addition
- subtraction
* multiplication
/ division
= assignment
() brackets for grouping calculations
Definition:
A flowchart is a graph consisting of geometrical shapes
that are connected by flow lines.
process storage
decision document
making
input/output connector
arrowheads
CT018-3-1 Introduction To C Programming Program Design Slide 63 (of 80)
Pseudocode for the Control Structures
DOWHILE...ENDDO
FOR…NEXT
REPEAT...UNTIL
:
:
: (Condition) True
ENDDO False
Action_1
An expression which
Group of determines whether Incrementation /
Decrementation
REPEAT
:
:
:
UNTIL (expression)
Read Value1,
Value2
Calculate
Sum = Value1 + Value2
Display
Sum
End
Read Amount
YES NO
Amount>20.00?
Calculate Calculate
Actual=Amount * 0.80 Actual=Amount
End
CT018-3-1 Introduction To C Programming Program Design Slide 65 (of 80)
Summary