Program Development Styles and Basics of C 3
Structured Programming
BASIC is widely believed to be an unstructured language. Modularity is not supported by BASIC. It
becomes difficult to debug a lengthy program written in BASIC. One should organize the programs
in modules and should write programs that are easy for others to read. Modular programming
concept is used in structured programming. A big program is to be split into modules or subroutines.
Instead of running through a number of lines, divide it into small modules. These modules are
easier to debug.
a) Larger programs are developed in structured programming such as Pascal and C. Here
programs are divided into multiple sub-modules and procedures.
b) Each procedure performs different tasks.
c) Each module has its own set of local variables and program code as shown in Fig. 1.3. Here,
the different modules are shown accessing the global data.
d) User-defined data types are introduced.
Fig. 1.3 Program in structured programming
1.2 PROGRAMMING STYLE
The program development styles are of two types:
1) Top-down design method
2) Bottom-up design method
1) Top-down design method: In the top-down design method, designing the system is initiated
from the top. The solution of the problem can be divided into smaller blocks. Initial view of solution
is not clear just like when an aeroplane descends from a great height the view to the ground is not
clear but when the plane approaches the ground things get clear and everything can be seen clearly
with our naked eyes. In a similar way, design is carried out. The strategy of designing a system is to
divide the task into many sub-tasks. We make a group that comprises task and sub-task. Each sub
task can be performed in a function. The function performs a well-defined job or task.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.26.221