Modular Programming
Modular Programming
Application file name of qbasic: QB.exe A small, logical and manageable functional part of
Extension file name of Qbasic: .bas program is known as procedure.
MODULAR PROGRAMMING
The process of breaking the large & complex programs There are two types of procedure in QBASIC there are
into small manageable part is called modular 1. SUB Procedure 2. Function Procedure
programming. SUB PROCEDURE
ADVANTAGES OF MODUALR PROGRAMMING A sub procedure is a small, logical and manageable
1. Different programmers can write different program functional part of program which perform specific
modules independently. action and does not return any value.
2. It is easy to design the code and test the program FEATURES OF SUB PROCEDURE
modules independently, 1. It does not return any value.
3. It is easy to understand and debug the program. 2. It is called by call keyword.
4. Modification in programs can be easily done. 3. It does not consider any data type.
5. It is possible to use single module in different places. 4. It can pass the parameter by both reference and value.
MODULE FUNCTION PROCEDURE
A small, logical and manageable program is called module. A function is a small, logical and manageable functional
Modules are divided into two parts: main module and part of program which perform specific action and returns
submodule. a single value to main module.
MAIN MODULE FEAUTRES OF FUNTION PROCEDURE
The top level controlling section or the entry point in 1. It returns value.
modular programming is called main module. 2. It can be called by expression or print statement.
SUB MODULE 3. It considers any data type.
Sub module is a program which is written under the main 4. It can pass the parameter by both reference and value.
module. There are two types of function. They are
A program may have one or more sub module under main 1. Library function or built in function
module. 2. User defined Function