SlideShare a Scribd company logo
2
Most read
4
Most read
6
Most read
Modular Programming
Chapter-9
Class-10
Presenter By: Bhuwan Bist
Computer Teacher,
Adarah Vidya Niketan Secondary
School
Bhuwan_Bista
Overview
• Modular programming is a technique used to divide our
program into many small, manageable and functional
module or block.
• Every modular program has one main module and many sub
module. The sub module of a program is also called as a
procedure.
• Main module is the top level module in which program entry
and exit takes place.
•Sub-Module is a block of statement that is used for specific
task and controlled by main module. Click to adBhuwan_Bista
Structure of Modular Programming
Main
Program-M1
Module-M2
Module-M6 Module-M7
Module-M3 Module-M4 Module-M5
Module-M8
Bhuwan_Bista
Advantages of Modular program
It reduces program codes.
 Increases the readability of program.
 Easy to debug program.
 Program maintenance become easier.
Module can be tested independently
Saving the time during project development.
Click tm Bhuwan_Bista
Types of Procedure in Qbasic Program
In Qbasic, a programmer can name a block of code can
be executed by simple calling out that name. These
name block of code are called procedures.
The two types of procedures are:
1. SUB Procedure
2. FUNCTION Procedure
Click t oBhuwan_Bista
add text
SUB Procedure
 A SUB Procedure is a small manageable and functional part
of program that performs specific task and does not return
any value to the calling module.
 The block of statements is placed with a pair of SUB/END
SUB statement and can be called by its name.
Bhuwan_Bista
Features of SUB Procedure
SUB procedure cannot be a part of an expression and does not
return any value.
SUB procedure do not have data type.
Argument can be passed to the subprogram by reference and
by value method.
SUB procedure name can't be used as a variable .
SUB procedure is called by CALL statement.
Bhuwan_Bista
Declaring SUB Procedure
 The DECLARE statement is used to declare a SUB procedure.
The syntax for the DECLARE statement is as follows:
DECLARE SUB name(parameter list)
Example:
DECLARE SUB volume(L,B,H)
SUB procedure volume with three parameters L,B and H
Bhuwan_Bista
Defining a SUB Procedure
oThe SUB....END SUB statement is a procedure
statement that marks the beginning and ending of a
subprogram. The syntax is:
SUB Procedure name [parameter, list]
[Statement]
END SUB
Bhuwan_Bista
Call a SUB Procedure
• The CALL statement is used to transfer control to another procedure,
a BASIC SUB program.
• The syntax is
CALL name(argument list)
Example:
CALL circumference(r)
Bhuwan_Bista
Example
• Write a program to create a sub-procedure to input the value of length,
breadth and height of a cuboid. The program should calculate the diagonal,
volume and of a cuboid.
FUNCTION Procedure
 A function is a small manageable and functional part of a
program that performs specific task and returns a value to the
main program or calling module.
 It is written with FUNCTON.....END FUNCTON Statements.
Bhuwan_Bista
Features of FUNCTION Procedure
⮚ FUNCTON procedure are used in expressions and can directly
returns a single value.
⮚ FUNCTION procedure have a data type which is the return
value of the function.
⮚ The parameters can be passed by reference or by value.
⮚ FUNCTION procedure can be recursive.
Bhuwan_Bista
Example
• Write a program to declare a user defined function using FUNCTION.....END
FUNCTION to print the area of a triangle by using expression method.
Bhuwan_Bista
The difference between Function procedure and SUB
procedure
SUB Procedure FUNCTION Procedure
The block of statement Is placed with a pair of
a SUB/END SUB statement and be called by
name.
The block of statement is placed with a pair of
FUNCTION/END FUNCTION statements and be
invoked from the reference of the function
name.
It dies nit return any value . It directly returns a single value
It does not have a data type It has a data type which is the return value of
the function.
Bhuwan_Bista
What are parameters?
Parameters are variables that receives data (argument values)
and the procedure (SUB/FUNCTION procedure)
Arguments: The constant and variable enclosed in the
parentheses of procedure call statement and that are supplied
to a procedure and known as arguments.
Bhuwan_Bista
Thank You

More Related Content

PDF
Types of software testing
PPT
Function Oriented Design
PPTX
Software Development Methodologies
PPT
Ch 3 event driven programming
PPTX
Software testing ppt
PDF
INTEGRATION TESTING
PPTX
Software Testing
PPT
Introduction To Software Configuration Management
Types of software testing
Function Oriented Design
Software Development Methodologies
Ch 3 event driven programming
Software testing ppt
INTEGRATION TESTING
Software Testing
Introduction To Software Configuration Management

What's hot (20)

PPT
Software Engineering (Introduction to Software Engineering)
PPT
Introduction to Software Project Management
PPT
Software Testing Strategies
PPTX
Android Architecture.pptx
PPTX
JAVA PROGRAMMING
PPT
Formal Specifications in Formal Methods
PDF
Debian or Yocto Project? Which is the best for your Embedded Linux project?
PPTX
Testing strategies
DOCX
A c program of Phonebook application
PPTX
Ch22-Software Engineering 9
PPTX
Network programming in java - PPT
PPTX
Software Configuration Management
PPTX
Evolutionary models
PPTX
PPT
ALM (Application Lifecycle Management)
PDF
PDF
Agile model
PPTX
software maintenance
PPTX
Software Engineering (Introduction to Software Engineering)
Introduction to Software Project Management
Software Testing Strategies
Android Architecture.pptx
JAVA PROGRAMMING
Formal Specifications in Formal Methods
Debian or Yocto Project? Which is the best for your Embedded Linux project?
Testing strategies
A c program of Phonebook application
Ch22-Software Engineering 9
Network programming in java - PPT
Software Configuration Management
Evolutionary models
ALM (Application Lifecycle Management)
Agile model
software maintenance
Ad

Similar to Modular programming (20)

PPTX
Modular programming
PPTX
Presentation of computer
PPTX
10.-Modular-Programming-with function and Sub Procedure.pptx
PPTX
Modular programming
PDF
Modular programming in qbasic
PPTX
Using general sub procedures
PPTX
Subprogramms
PPTX
9. DBMS Experiment Laboratory PresentationPPT
PPTX
Modularisation techniques new
DOC
Chapter 5 notes new
PPTX
Subroutines igcses computer science powerpoint
PPTX
Function & procedure
DOC
Chapter 6 notes
PPTX
VB Function and procedure
PDF
Function procedure c6 c7
PPT
Lecture11 abap on line
PDF
Unit iii vb_study_materials
PDF
PSPC-UNIT-4.pdf
PPTX
Chap6 procedures & macros
PDF
Functions-Computer programming
Modular programming
Presentation of computer
10.-Modular-Programming-with function and Sub Procedure.pptx
Modular programming
Modular programming in qbasic
Using general sub procedures
Subprogramms
9. DBMS Experiment Laboratory PresentationPPT
Modularisation techniques new
Chapter 5 notes new
Subroutines igcses computer science powerpoint
Function & procedure
Chapter 6 notes
VB Function and procedure
Function procedure c6 c7
Lecture11 abap on line
Unit iii vb_study_materials
PSPC-UNIT-4.pdf
Chap6 procedures & macros
Functions-Computer programming
Ad

Recently uploaded (20)

PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
PDF
Classroom Observation Tools for Teachers
PDF
Basic Mud Logging Guide for educational purpose
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
Pre independence Education in Inndia.pdf
PPTX
Cell Types and Its function , kingdom of life
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PDF
Complications of Minimal Access Surgery at WLH
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Insiders guide to clinical Medicine.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Computing-Curriculum for Schools in Ghana
STATICS OF THE RIGID BODIES Hibbelers.pdf
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
GDM (1) (1).pptx small presentation for students
Introduction_to_Human_Anatomy_and_Physiology_for_B.Pharm.pptx
Classroom Observation Tools for Teachers
Basic Mud Logging Guide for educational purpose
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Pre independence Education in Inndia.pdf
Cell Types and Its function , kingdom of life
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Sports Quiz easy sports quiz sports quiz
human mycosis Human fungal infections are called human mycosis..pptx
102 student loan defaulters named and shamed – Is someone you know on the list?
Complications of Minimal Access Surgery at WLH
PPH.pptx obstetrics and gynecology in nursing
Insiders guide to clinical Medicine.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Final Presentation General Medicine 03-08-2024.pptx
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Computing-Curriculum for Schools in Ghana

Modular programming

  • 1. Modular Programming Chapter-9 Class-10 Presenter By: Bhuwan Bist Computer Teacher, Adarah Vidya Niketan Secondary School Bhuwan_Bista
  • 2. Overview • Modular programming is a technique used to divide our program into many small, manageable and functional module or block. • Every modular program has one main module and many sub module. The sub module of a program is also called as a procedure. • Main module is the top level module in which program entry and exit takes place. •Sub-Module is a block of statement that is used for specific task and controlled by main module. Click to adBhuwan_Bista
  • 3. Structure of Modular Programming Main Program-M1 Module-M2 Module-M6 Module-M7 Module-M3 Module-M4 Module-M5 Module-M8 Bhuwan_Bista
  • 4. Advantages of Modular program It reduces program codes.  Increases the readability of program.  Easy to debug program.  Program maintenance become easier. Module can be tested independently Saving the time during project development. Click tm Bhuwan_Bista
  • 5. Types of Procedure in Qbasic Program In Qbasic, a programmer can name a block of code can be executed by simple calling out that name. These name block of code are called procedures. The two types of procedures are: 1. SUB Procedure 2. FUNCTION Procedure Click t oBhuwan_Bista add text
  • 6. SUB Procedure  A SUB Procedure is a small manageable and functional part of program that performs specific task and does not return any value to the calling module.  The block of statements is placed with a pair of SUB/END SUB statement and can be called by its name. Bhuwan_Bista
  • 7. Features of SUB Procedure SUB procedure cannot be a part of an expression and does not return any value. SUB procedure do not have data type. Argument can be passed to the subprogram by reference and by value method. SUB procedure name can't be used as a variable . SUB procedure is called by CALL statement. Bhuwan_Bista
  • 8. Declaring SUB Procedure  The DECLARE statement is used to declare a SUB procedure. The syntax for the DECLARE statement is as follows: DECLARE SUB name(parameter list) Example: DECLARE SUB volume(L,B,H) SUB procedure volume with three parameters L,B and H Bhuwan_Bista
  • 9. Defining a SUB Procedure oThe SUB....END SUB statement is a procedure statement that marks the beginning and ending of a subprogram. The syntax is: SUB Procedure name [parameter, list] [Statement] END SUB Bhuwan_Bista
  • 10. Call a SUB Procedure • The CALL statement is used to transfer control to another procedure, a BASIC SUB program. • The syntax is CALL name(argument list) Example: CALL circumference(r) Bhuwan_Bista
  • 11. Example • Write a program to create a sub-procedure to input the value of length, breadth and height of a cuboid. The program should calculate the diagonal, volume and of a cuboid.
  • 12. FUNCTION Procedure  A function is a small manageable and functional part of a program that performs specific task and returns a value to the main program or calling module.  It is written with FUNCTON.....END FUNCTON Statements. Bhuwan_Bista
  • 13. Features of FUNCTION Procedure ⮚ FUNCTON procedure are used in expressions and can directly returns a single value. ⮚ FUNCTION procedure have a data type which is the return value of the function. ⮚ The parameters can be passed by reference or by value. ⮚ FUNCTION procedure can be recursive. Bhuwan_Bista
  • 14. Example • Write a program to declare a user defined function using FUNCTION.....END FUNCTION to print the area of a triangle by using expression method. Bhuwan_Bista
  • 15. The difference between Function procedure and SUB procedure SUB Procedure FUNCTION Procedure The block of statement Is placed with a pair of a SUB/END SUB statement and be called by name. The block of statement is placed with a pair of FUNCTION/END FUNCTION statements and be invoked from the reference of the function name. It dies nit return any value . It directly returns a single value It does not have a data type It has a data type which is the return value of the function. Bhuwan_Bista
  • 16. What are parameters? Parameters are variables that receives data (argument values) and the procedure (SUB/FUNCTION procedure) Arguments: The constant and variable enclosed in the parentheses of procedure call statement and that are supplied to a procedure and known as arguments. Bhuwan_Bista