Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
For
Program Design
Flowcharts vs Pseudocode
Flowcharts were the first design tool to be
widely used, but unfortunately they do not
reflect some of the concepts of structured
programming very well.
Pseudocode, on the other hand, is a newer
tool and has features that make it more
reflective of the structured concepts.
The drawback is that the narrative presentation
is not as easy to understand and/or follow.
2
Selection:
IF, ELSE (or ELSEIF), ENDIF
must be in line
Indent all statements that depend
on a condition
Loop:
WHILE, ENDWHILE
Indent statements that fall inside
the loop but not keywords that
form the loop
Also REPEAT, UNTIL
interestRate = .06
no
interestRate = .10
Pseudocode
WHILE / ENDWHILE
count = 0
WHILE count < 10
ADD 1 to count
WRITE count
ENDWHILE
WRITE The
End
Start
count = 0
count
<10
add 1 to
count
write count
Write
The End
Stop
Mainline
count = 0
WHILE count < 10
DO Process
ENDWHILE
WRITE The End
Modular
Process
ADD 1 to count
WRITE count
8
REPEAT / UNTIL
Start
count = 0
add 1 to
count
write count
count
<10
Write
The End
Stop
count = 0
REPEAT
ADD 1 to count
WRITE count
UNTIL count >= 10
WRITE The End
Mainline
count = 0
REPEAT
DO Process
UNTIL count >= 10
WRITE The End
Modular
Process
ADD 1 to count
WRITE count
9
Flowchart vs Pseudocode
Flowchart Advantages:
Standardized
Visual
Flowchart Disadvantages:
Hard to modify
Structured design elements
not implemented
Special software required
Pseudocode Advantages
Easily modified
Implements structured
concepts
Done easily on Word
Processor
Pseudocode
Disadvantages:
Not visual
No accepted standard, varies
from company to company
10
Access of Data
The READ statement tells the computer to get a
value from an input device and store it in a memory
location.
How to deal with memory locations which have been
allocated an address e.g. 19087
11
12
subtract
multiply
divide
exponentiation
grouping
Selection
>
<
=
>=
<=
<>
greater than
less than
equal to
greater than or equal to
less than or equal to
not equal to
13