Tuesday, May 28, 2024

Chapter-9 [Modular Programming]

Answer the following questions

  1. What is modular programming? List any two advantages of modular programming.
    The process of subdividing a computer program into separate sub-programs is called modular programming.
    i. Different programmer can design different programs modules independently.
    ii. It is easy to use, code and test.
    iii. It is possible to use a single module in different places, which reduces the program codes.

  2. What is looping?
    The repetition of a certain block of statements to the specified number of times or until the given condition is satisfied is called looping.

  3. What is procedure? What are the types of procedures?
    A procedure is a small, logical and manageable functional part of a program that solves the particular problem.
    The two types of procedures used in QBASIC are:
    i. SUB Procedure
    ii. FUNCTION Procedure

  4. Which statement is used to call SUB procedure?
    CALL statement is used to call SUB procedure.

  5. Define local and global variables.
    A variable which are declared in a sub module and are only accessible to that specific module is called local variable.
    A variable which are declared in a main module and are accessible to any other procedure is known as global variable. It is defined in a main module by using DIM or COMMON statement along with SHARED attribute.

  6. What is argument and parameter?
    Arguments are the values that are sent to the procedures.
    Parameters are the variables that will receive data sent to the procedures.

  7. What is formal parameter and actual parameter?
    The parameter in the procedure which receives the value from the actual parameter is called formal parameter.
    The parameter passed to the procedure from the calling procedure are called actual parameter.


Please enter your comment!
Please enter your name here