You are on page 1of 1

6/13/2012

Identifying Modular Approach to Programming

Identifying Modular Approach to Programming (Contd.)

A program needs to be amended periodically to respond to changing conditions or requirements. This encouraged programmers to adopt a more disciplined approach to program writing. The techniques that were adopted are known as modular or structured programming techniques. Modular programming includes features that are designed not only to solve the problem at hand but also to make the logic clear to someone reading the program.

Long, continuous programs can be broken up into a series of individual modules that are related to each other in a specified manner.
Main Program

Module1

Module2

Module3

Identifying Modular Approach to Programming (Contd.)

Identifying Modular Approach to Programming (Contd.)

Example:
Flowchart to show modular programming
Start numeric nNum1, nNum2, nNum3, nSum Add

Example:
Accept the test scores for 10 students and display their individual averages. The scores of the students cannot be negative. The table shows the variables used in the flowchart.
Variable Student Name
Return Add

Accept nNum1, nNum2, nNum3

nSum=nNum1 + nNum2 + nNum3

Data Type character numeric numeric numeric numeric

Variable Name cStudentName nTest1 nTest2 nTest3 nAverage

Score of Test 1 Score of Test 2

Display nSum

Score of Test 3
Stop

Average of Test Scores

18

You might also like