This document discusses modular programming techniques. Modular programming involves separating a program's functionality into independent, interchangeable modules. Each module contains code to perform a specific task. The main advantages of modular programming are that it makes programs easier to design, test, maintain and reuse code. Modules can take the form of sub procedures or function procedures. Sub procedures perform tasks without returning values, while function procedures return a single value. Variables can be shared between modules using common, dim with shared, or shared statements.
An enumeration (enum) is a user-defined type (same as structure) that represents a group of constants. typedef is a keyword used to create alias name for the existing datatypes.
An enumeration (enum) is a user-defined type (same as structure) that represents a group of constants. typedef is a keyword used to create alias name for the existing datatypes.
For most programming/scripting languages the concepts are all the same. The only thing that changes is the syntax in which it is written. Some languages may be easier to remember than others, but if you follow the basic guide line, it will make learning any programming language easier. This is in no way supposed to teach you everything about programming, just a general knowledge so when you do program you will understand what you are doing a little bit better.
This Powerpoint presentation covers following topics of C Plus Plus:
Features of OOP
Classes in C++
Objects & Creating the Objects
Constructors & Destructors
Friend Functions & Classes
Static data members & functions
For most programming/scripting languages the concepts are all the same. The only thing that changes is the syntax in which it is written. Some languages may be easier to remember than others, but if you follow the basic guide line, it will make learning any programming language easier. This is in no way supposed to teach you everything about programming, just a general knowledge so when you do program you will understand what you are doing a little bit better.
This Powerpoint presentation covers following topics of C Plus Plus:
Features of OOP
Classes in C++
Objects & Creating the Objects
Constructors & Destructors
Friend Functions & Classes
Static data members & functions
In this presentation Skillwise provides you the Cobol Programming Basics. COBOL is primarily used in business, finance, and administrative systems for companies and governments.
This presentation covers the syllabus of Himachal Pradesh University for the subject of ASP.NET Technologies. This is part -2 of a syllabus. This is particularly for BCA students.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
How to Create Map Views in the Odoo 17 ERPCeline George
The map views are useful for providing a geographical representation of data. They allow users to visualize and analyze the data in a more intuitive manner.
2. OVERVIEW
■ Modular programming is a technique of developing software by
separating the functionality of a program into independent
interchangeable modules that are combined together to get the final
working software.
■ Modular programming is a technique used to divide program into many
small, manageable, logical and functional modules or blocks.
■ Modular programming is a software design technique that emphasizes
separating the functionality of a program into independent,
interchangeable modules, such that each contains everything necessary
to execute only one aspect of the desired functionality.
Modular Programming
3. Cont……..
■ Every modular program consist of one main module and one or more
sub modules or procedures.
■ Each module has a unique name.
■ Main module is the top level module in which program entry and exist
takes place.
■ The main module is the controlling section of a modular programming.
■ Sub modules is a block of statement that is used for specific task and is
written under the main module.
■ It allows the user to divide into manageable and functional modules or
blocks with the help of sub procedure and function procedure.
Modular Programming
4. Cont……
■ QBASIC programs consists of one or more modules.
■ A module is a block of statement that solve particular
problem.
■ A module may contain SUB and FUNCTION
procedure, as well as code not part of SUB or
FUNCTION
Modular Programming
6. Advantages
■ Different programmers can design different program modules independently, which is
required in a large and complex program.
■ it is easy to design code and test the program modules independently.
■ It is possible to use a single module in different places which reduces program codes.
■ Reduce redundancy
■ Improving the readability of a program.
■ Program maintenance becomes easier.
■ Saving the time.
■ Encourages re-use of code.
Modular Programming
7. Types of Procedures
■ In QBASIC, a programmer can name a block of code which
can be executed by simply calling out that name.These name
blocks of code are called procedures.
■ The two types of procedures are:
i. SUB Procedure
ii. Function Procedure
Modular Programming
8. SUB Procedure
■ SUB procedure is a block of statements which is identified by
a unique name that performs a specific task.
■ The block of statements is placed with a pair of SUB … END
SUB statements and can be called by its name.
■ A SUB-procedure is a small, logical and manageable
functional part of program which performs specific task and
does not return any value.
Modular Programming
9. Features of SUB Procedures
■ SUB procedure does not return any value.
■ SUB procedure can be recursive.They may call
themselves.
■ Sub procedure do not have data types.
Modular Programming
10. SYNTAX (Parameterized)
■ Declaration
DECLARE SUB <name> (parameter list)
■ Definition
SUB <name> (parameter list)
` procedure variable definitions and
statements
END SUB
■ Calling
CALL <name>(argument list)
Modular Programming
11. SYNTAX(Non Parameterized)
■ DECLARE SUB <name> ()
■ CALL <name>
■ SUB <name>
` procedure variable definitions and
statements
■ END SUB
Modular Programming
12. Declaring SUB Procedure
■ The DECLARE statements is used to declare a SUB
procedure.
■ The syntax for the DECLARE statements is as follows:
DECLARE SUB <name>(parameter list)
Example:
DECLARE SUB AOR(L,B)
Sub procedure AOR with two parameter L and B
DECLARE SUB AOR
Sub procedure AOR with no parameters
Modular Programming
13. Defining a SUB procedure
■ The SUB …… END SUB statements is a procedure statements
that marks the beginning and ending of a sub program.The
syntax is:
SUB <name>(parameter list)
procedure variable definitions and statements
END SUB
Modular Programming
14. Calling a SUB Procedure
■ The CALL statements is used to transfer control to
another procedure, a BASIC SUB program.
■ The syntax is :
CALL <name> (argument list)
Example:
CALL AOR(L,B)
Modular Programming
15. Function Procedure
■ A function procedure is a small, logical and functional part of a program
which performs the specific tasks and it returns a single value to the
main program or calling module.
■ The returned value may be string or number.
■ It is either called by using PRINT statement or storing a returned value
into a variable.
Modular Programming
16. SYNTAX(Parameterized)
■ Declaration
DECLARE FUNCTION <name> (parameter list)
■ Definition
FUNCTION <name> (parameter list)
` procedure variable definitions and statements
<name> = Expression
END FUNCTION
■ Calling
PRINT <name>(argument list)
OR
variable = <name>(argument list)
Modular Programming
17. SYNTAX(Non-Parameterized)
■ Declaration
DECLARE FUNCTION <name> ()
■ Definition
FUNCTION <name>
` procedure variable definitions and statements
<name> = Expression
END FUNCTION
■ Calling
PRINT <name>
OR
variable = <name>
Modular Programming
18. Differences
SUB Procedure Function Procedure
The block of statements placed under SUB/END SUB
statements and can be called by its name.
The block of statements placed under
FUNCTION/END FUNCTION statements and can be
invoked from the reference of the function name.
It does not return any value to the calling module It returns a single value to calling module.
It does not have any datatype in its name. It have datatype in its name which is the return value
of a function.
Modular Programming
19. ARGUMENTAND PARAMETER
■ The constants or variables enclosed in the parentheses are supplied to a procedure are
known as Arguments.
■ Argument are also known as Actual Parameter.
■ The variables in a procedure which accepts data or variable passed to them from the
calling module are known as Parameters.
■ Parameter are also known as Formal Parameter.
Modular Programming
20. LOCAL AND GLOBALVARIABLE
■ A variable which is declared inside a module and cannot be accessed by other module
is known as local variable.
■ All variables that are declared either implicitly or explicitly without using SHARED
attribute are local variable.
■ The variable in main module which ca be accessed from any module or procedure of a
program is known as Global variable.
■ A Global variable is declared in the main module by two methods.
Modular Programming
21. 1. Declaring by using COMMON Statement.
Syntax:
COMMON SHARED Variable list
where,
SHARED indicates that variable are shared with all procedures.
variable list A list of one or more variables to be shared in the program.
e.g. COMMON SHARED A, B, C
2. Declaring using DIM statement.
Syntax:
DIM SHARED variable list
e.g. DIM SHARED A$
Modular Programming
23. ■ Variables can be shared among parts of a module without making the variables global
by using the SHARED statement.
Syntax:
SHARED variable list
e.g.
DECLARE SUBTEMPERATURE()
INPUT”ENTERTEMPERATURE IN CELCIUS”;C
CALLTEMPERATURE
END
SUBTEMPERATURE
SHARED C
F= 9 * C/5 + 32
PRINT “TEMPERATURE IN FAHRENHEIT”;F
END SUB
Modular Programming