Modular programming is an approach of programming in which a large program is divided into separate independent units called modules.

We are learning only ways to prepare small programs, which only contain some line of codes. Do you know what? The software’s which we use in our daily life such as Microsoft Word, Microsoft Excel, MS-Paint, Word-Pad, Notepad, PowerPoint like application software also build by writing a line of codes. To build this types of program programmers have to write thousands or millions of line of codes, which is very tedious task. Now you can guess so, how difficult it is to write a lot of codes and how hard it is to prepare. How to find out the mistakes in such a long code? how to add and remove some codes in the big program? and how to handle the problem?

To solve this problem, the programmers have to use the concept of modular programming. Actually we follow this technique when our programs becomes large, we divided large program into small pieces called module. By making small block of statements inside the module. We write many lines of code inside our module to do a particular task, simply like to add two numbers, to find the area of geometrical objects and to do various complex task. We can test each module separately and we can easily debug the program.

Module refers to the block of statement or set of instructions to perform specific task in the program. It is also known as ‘Procedure’. To build the complete software programmers has to make many separate modules and finally these modules combined together.

Advantages of Modular Programming

There are many advantages of modular programming, some of them are give below.

  • It’s easy to understand and manage the program’s code.
  • In different modules of the same program, different programmers can be able to work in the same time, for that reason within short period of time perfect program can be prepared.
  • Once the module is ready, the module can be repeatedly used in anywhere the program. Due to this time and computer memory will be saved.
  • Each module can be test by running it separately, due to this programmers can find the faults in the program and debug them.
  • Changing something in the program will be quick and easy.

Procedure

Procedure is a set of instructions which is build to perform specific task in the program. It is also known as sub-program. Each procedure has their one unique name which is also called procedure name. We can use this procedure in any part of the program by calling them. In QBASIC there are two types of procedures.

  1. SUB Procedure
  2. FUNCTION Procedure

 

Table of Content