Document 15071926

advertisement
Matakuliah
Tahun
: T0104 – Metode Perancangan Program
: 2010
REVIEW STRUCTURED PROGRAM DESIGN
Pertemuan - 13
Pertemuan 13 – Review
Simple Structured Program Design
Objectives
• In this chapter you will be able to:
• See the revision of the steps required to achieve
good top-down program design
Simple Program Design
1. Define the problem
To do this, underline the nouns and verbs in the
problem description
This helps to divide the problem into its input,
output, and processing components
Simple Program Design
2. Group the activities into subtasks or functions
To do this, look at the defining diagram and group the
activities in the processing component into separate
tasks
These tasks will become the modules in the program
A module is dedicated to the performance of a single
function
Simple Program Design
3. Construct a hierarchy chart
The hierarchy chart shows not only the modules
of the program, but also their relationship to
each other, in a similar fashion to the
organizational chart of a large company
Simple Program Design
4. Establish the logic of the mainline of the algorithm
Use pseudocode and the three basic control structures to
establish this logic
Pseudocode is a subset of English that has been formalized
and abbreviated to look like a high-level computer language
Keywords and indentation are used to signify particular
control structures
The three basic control structures are simple sequence,
selection, and repetition
Simple Program Design
5. Develop the pseudocode for each successive module in
the hierarchy chart
The algorithms for these modules should be developed
in a top-down fashion
That is, the pseudocode for each module on the first
level should be established before attempting the
pseudocode for the modules on the next or lower level
Simple Program Design
6. Desk check the solution algorithm
By desk checking the algorithm, you attempt to find
any logic errors that may have crept into the
solution
Desk checking involves tracing through the logic of
the algorithm with some chosen test data exactly as
the computer would operate
Summary
• This chapter has revisited the steps required to
achieve good top-down program design
• Program design is considered good if it is easy
to read and understand and easy to alter
Download