Modular Programming in QBASIC
Modular Programming in QBASIC
Modular Programming in QBASIC
M2 M3 M4
M5 M6 M7
e) What are the advantages of Modular programming?
i) Single modules can be use in different places.
ii) Different programmers can develop different program modules independently.
f) QBASIC is known as modular programming. Why?
QBASIC is known as Modular programming because it uses the technique of “Divide and Conquer” to
solve a problem.
g) Differentiate between library function and user defined function
Library function:-
Function provided by QBASIC itself are called library function or Build in function or standard function.
There two type of library function. They are i) string function ii) Numeric function
USER Define function:-
QBASIC allows creating users own function. Function created by user are called user defined function
h) Differentiate between Local variable and Global variable
Local Variable:-Variable declared inside the procedure are local by default .Its values are protected from
outside interference and value have no effect on the variable outside the procedures.
Global variable:-
Variable, which can be accessed from any procedures or module, is called global variable.
i) What are parameters and arguments?
Parameters are variables that will receive data(argument values) sent to the procedures(Subprograms and
functions)
Arguments are values that are sent to the procedures (Subprograms and function)
j) Differentiate between SHARED and COMMON SHARED.
SHARED statement is used in the subprogram to share the values of certain variable between main module
and subprogram.
A COMMON SHARED statement is used in main program to share variable list between main program
and all sub programs.
DECLARE - a non-executable statement that declares references to BASIC procedures and invokes
argument type checking
Syntax
DECLARE {FUNCTION | SUB } name [([parameterlist])]
_ name is the name that will be used to call the procedure
_ parameterlist indicates the number and type of arguments that will
be used to call the procedure