Professional Documents
Culture Documents
Topic 1 - Proramming Methodology Introduction
Topic 1 - Proramming Methodology Introduction
Recognize the need for information – collect info from the problem owner.
Analyze the problem very well in order to understand what is required of its solution –
s/w, h/w, etc.
Define what output is required – reports to be generated.
Define the input required to provide the required output - user-interface.
Establish the processing requirements – algorithms and data structures.
b) Designing a solution
Programming involves three basic logic patterns as indicated below.
Simple sequence
Here, events follow one after the other as indicate by the sketch below.
1
Selection
As indicated in the sketch below, selection involves branching or choosing an alternative
No Yes
Looping
As indicated in the diagram below, looping involves repeating statements visited earlier.
No Yes
Before writing the program, one may be required to develop the algorithm or Pseudo code
for the problem. By Pseudo code, we refer to English-like statements or narrative
descriptions of processing steps to be performed in the program.
2
If the problem is complex, a flowchart, i.e., block diagram of the logic to be captured in the
program may be required. A flowchart provides a visual frame of reference to the
processing steps in the program. Some of the symbols used in flowcharting are given below.
Start/stop
Process
Input/output
Decision
Data flow
a) Comments
These are statements that improve the readability of the program. The computer is
required to ignore them since they are not executable.
b) Declarations
Declaration are statements that give the data types of the items to be used in the program
e.g., variables.
c) Input/output
d) Computation
e) Transfers of control, e.g., GO TO
f) Comparisons, e.g., if … then …