Grade 12 Exam  >  Grade 12 Notes  >  Computer Science for Grade 12  >  Detailed Notes: Functions

Detailed Notes: Functions | Computer Science for Grade 12 PDF Download

Download, print and study this document offline
Please wait while the PDF view is loading
 Page 2


Introduction 
? Large programs are often difficult to manage, thus 
large programs are divided into smaller units known as 
functions. 
? It is simply a group of statements under any name i.e. 
function name and can be invoked (call) from other part 
of program. 
? Take an example of School Management Software, now 
this software will contain various tasks like Registering 
student, Fee collection, Library book issue, TC 
generation, Result Declaration etc. In this case we have 
to create different functions for each task to manage 
the software development. 
Page 3


Introduction 
? Large programs are often difficult to manage, thus 
large programs are divided into smaller units known as 
functions. 
? It is simply a group of statements under any name i.e. 
function name and can be invoked (call) from other part 
of program. 
? Take an example of School Management Software, now 
this software will contain various tasks like Registering 
student, Fee collection, Library book issue, TC 
generation, Result Declaration etc. In this case we have 
to create different functions for each task to manage 
the software development. 
Introduction 
? Set of functions is stored in a file called MODULE. 
And this approach is known as MODULARIZATION, 
makes program easier to understand, test and 
maintain.  
? Commonly used modules that contain source code 
for generic need are called LIBRARIES. 
? Modules contains set of functions. Functions is of 
mainly two types: 
? Built-in Functions 
? User-Defined Functions 
Page 4


Introduction 
? Large programs are often difficult to manage, thus 
large programs are divided into smaller units known as 
functions. 
? It is simply a group of statements under any name i.e. 
function name and can be invoked (call) from other part 
of program. 
? Take an example of School Management Software, now 
this software will contain various tasks like Registering 
student, Fee collection, Library book issue, TC 
generation, Result Declaration etc. In this case we have 
to create different functions for each task to manage 
the software development. 
Introduction 
? Set of functions is stored in a file called MODULE. 
And this approach is known as MODULARIZATION, 
makes program easier to understand, test and 
maintain.  
? Commonly used modules that contain source code 
for generic need are called LIBRARIES. 
? Modules contains set of functions. Functions is of 
mainly two types: 
? Built-in Functions 
? User-Defined Functions 
Advantages of Function 
? PROGRAM HANDLING EASIER : only small part of the 
program is dealt with at a time. 
? REDUCED LoC: as with function the common set of code 
is written only once and can be called from any part of 
program, so it reduces Line of Code 
? EASY UPDATING : if function is not used then set of 
code is to be repeated everywhere it is required. 
Hence if we want to change in any formula/expression 
then we have to make changes to every place, if 
forgotten then output will be not the desired output. 
With function we have to make changes to only one 
location. 
Page 5


Introduction 
? Large programs are often difficult to manage, thus 
large programs are divided into smaller units known as 
functions. 
? It is simply a group of statements under any name i.e. 
function name and can be invoked (call) from other part 
of program. 
? Take an example of School Management Software, now 
this software will contain various tasks like Registering 
student, Fee collection, Library book issue, TC 
generation, Result Declaration etc. In this case we have 
to create different functions for each task to manage 
the software development. 
Introduction 
? Set of functions is stored in a file called MODULE. 
And this approach is known as MODULARIZATION, 
makes program easier to understand, test and 
maintain.  
? Commonly used modules that contain source code 
for generic need are called LIBRARIES. 
? Modules contains set of functions. Functions is of 
mainly two types: 
? Built-in Functions 
? User-Defined Functions 
Advantages of Function 
? PROGRAM HANDLING EASIER : only small part of the 
program is dealt with at a time. 
? REDUCED LoC: as with function the common set of code 
is written only once and can be called from any part of 
program, so it reduces Line of Code 
? EASY UPDATING : if function is not used then set of 
code is to be repeated everywhere it is required. 
Hence if we want to change in any formula/expression 
then we have to make changes to every place, if 
forgotten then output will be not the desired output. 
With function we have to make changes to only one 
location. 
User Defined Functions 
? A function is a set of statements that performs a specific 
task; a common structuring elements that allows you to 
use a piece of code repeatedly in different part of 
program.  Functions are also known as sub-routine, 
methods, procedure or subprogram. 
? Syntax to create USER DEFINED FUNCTION 
def function_name([comma separated list of parameters]): 
 statements…. 
 statements…. 
KEYWORD 
FUNCTION DEFINITION 
Read More
1 videos|25 docs|18 tests
Related Searches

shortcuts and tricks

,

Summary

,

Viva Questions

,

Detailed Notes: Functions | Computer Science for Grade 12

,

video lectures

,

past year papers

,

Detailed Notes: Functions | Computer Science for Grade 12

,

ppt

,

Objective type Questions

,

MCQs

,

Detailed Notes: Functions | Computer Science for Grade 12

,

Semester Notes

,

Sample Paper

,

Exam

,

Previous Year Questions with Solutions

,

mock tests for examination

,

Free

,

practice quizzes

,

pdf

,

study material

,

Important questions

,

Extra Questions

;