Вы находитесь на странице: 1из 6

Lesson Plan

Subject- Informatics Practices (065)


Class – XII
Topic:
Procedure, Functions and Modules in VB

Date: 11, Aug. 2008 Duration: 35 Mins

Visual Basic Procedures, Functions and Modules

• Basics
• Procedure- Sub , Function and Property Procedures
• Sub Procedures
• Function Procedures
• Modules
• Recapitulation
Prep ared By-
Designed by --
• Assignment A.P.S.
A.P.S. Ku shwah
Kushwah
PGT
PGT- -CS
CS
Ken
Kenriya
d driya Vidy
Vidalaya
yalaya , ,Damooh
Damh

General Aim
 To understand the nature of Computer Science and IT by applying basic scientific and
conceptual approach of thinking, problem solving and decision-making.
 To understand logical thinking.
 The problem has to be understood thoroughly and the expected output has to be
identified.
 To relate theoretical knowledge with project based learning.

 To Minimize chance of errors and cost of applications development and maintenance

Specific Aim
• After completion of this topic students should come to know about the problem solving
and decision making techniques by using procedure and modules in VB..
• They will know about the phenomena of stored program blocks for performing
repetitive actions and decision-making.
• To provide the knowledge about modularity and handling of stored procedure blocks.
Teaching Method
• Lecture cum Demonstration method along with question - answer activity will be
followed

Teaching Aids

• White board, Marker, Rubber, Computer& LCD Projector and other peripherals

Motivation
• Students should be motivated by using sum questions which are general type and
Linked with there previous knowledge such as
• What is a Program?
• How to design a program in VB?
• What are the major types of control statements used in VB?
• What is Modularity?
• What is code container?
• How to define code containers in VB?
• How to define procedures and modules and implement them?

Presentation
Introduction
• Today we are going to learn about procedures in VB and how to organize them in
various ways?

Aim
• Today we are going to focus on the significance of Visual Basic procedures and
Modules.

TEACHING MATTER TEACHER’S ACTIVITY STUDENT’S ACTIVITY


I will explain the significance of
procedures in the Visual Basic
programming and I will explain
Procedures- how to reduce code duplication
A block of code which perform and complexity by means of
one or more specific tasks code isolation and code shearing
to minimize the chance of errors
Need for the procedures…. and cost of application
development in the
programming.
Ans 1.
Q1. What is the use of To increase the modularity and
simplicity in the programming.
Procedure?

To eliminate redundancy and


increase the order of flexibility.
Provides easiness in application
development, detection of
errors and their correction or
isolation. Ans 2.
There are 3-types of procedures.
They are-
Q2. How many types of Sub procedure

procedures are used in Function procedure


Event procedure
VB?

Procedure & its Classification A sub procedure performs a


task but doesn’t return a value.
A General Procedure is the one
that you create for your own
purpose.
Once a General procedure is
defined, it must be specially
invoked by the application.
It is invoked when the CALL
statement is executed for it.
i.e. Call aps()
An Event Procedure is
associated with a specific event
of an object.
It is named in a way that
indicated the object and event
clearly.
i.e. cmdOK_click()
Q3. What is Function
Ans-3
Procedure?
A set of statement used to
Function Procedure It Performs a specific task perform a specific task.
and returns a value.
On the basis of arguments
and return type they are of
four types.

Ans 4
Q4. Give the difference A function can return a value
Function Procedure
between function and sub but a sub procedure can’t return
procedures in VB? a value.
Library functions are the Ans5 Library functions are
Library Function inbuilt functions, which are
defined by the compiler. defined by the compiler,
Q.5 What is the difference whereas UDF’s are defined
between a library function by the Users.
a. String Functions- len(),
and UDF? Give the types of
Mid(),Lcase(),Ucase() etc
Modules Library Functions?
b. Numeric Function- Fix(),
Modules are the building
blocks of a project. It is a int(), round(), RND() etc
collection of procedures c. Date & Time Functions
functions and events. That’s
why it is also called code Date(), now() etc
container. d. Miscellaneous Functions-
There are three types of
modules. Msgbox(), inputbox()
a. Form Module
b. Standard Module
c. Class Module Ans6 Code container stores
Q6. What is container?
some thing. Since module
Why module is called as code
stores codes and procedures
container?
that’s why it is a ontainer.

Types of Modules Form Module – Provides the


user interface to an
application and having
extension .frm

Standard Module- contains


common code needs to be
executed in several forms. Its
extension is .bas
Class Module- stores the blue Ans7-
print of user created custom
.FRM for Form Module
objects. Its extension is .cls
Q.7. Give the extension name .BAS for Standard Module
of all three types of modules? .CLS for Class Module

Recapitulation/Evaluatory Questions :-
Q.1 What are the different types of blocks used in VB?

Q.2 Distinguish between event and general procedures?

Q.3 What do you mean by arguments?

Q4. What do you understand by call by reference and call by value?

Q.5 What are the different types of functions are used in VB?

Q.6. What do you mean Library function? Differentiate between library function and
user defined functions?

Q.7. What are the types of various Modules in VB?

Home Work/ Assignment


Design procedures in Vb to perform following tasks:

Q. 1 To check whether the given number is prime or non prime.


Q.2 To check whether the given number is an Armstrong number or not.
Q.3 To check whether the given year it is Leap year or general year.
Q.4 To check whether a person is a valid voter or not.
Q.5 Design a function in VB to print the table of any user given number by
using call by reference method.
Presented by :
A P. S. KUSHWAH
Checked By- Inspected By-

Sh. M.P.Singh
Principal Sh. ……………
K V Damoh Principal
KV……………
Comment Pl’s:

…………………………
…………………………
…….................................

Вам также может понравиться