12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications மின்னணு தரவு பரிமாற்றம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிக பாதுகாப்பு அமைப்புகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின்னணு செலுத்தல் முறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications மின் - வணிகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications திறந்த மூல கருத்துருக்கள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு வடமிடல் Sample Question Papers Study Material - QB365 Set A

Published on: 06/01/2020
Scoping
Download Tamil Nadu 12th Standard Computer Science question papers, model tests, one-mark questions, important questions, and public exam papers in PDF format. Free study materials and answer keys for TN State Board students.
Questions + Answers key
Take MCQ Computer Science Test

1.
How the names are mapped with objects in programming language?
name == object
name:: object
name:= object
object:= name
2.
Which of the following keeps track of all these mappings with namespaces?
Programming languages
Application software
System software
MySQL
3.
Which of the following members of a class can be handled only from within the class?
Public members
Protected members
Secured members
Private members
4.
The process of subdividing a computer program into separate sub-programs is called
Procedural Programming
Modular programming
Event Driven Programming
Object oriented Programming
5.
Which scope refers to variables defined in current function?
Local Scope
Global scope
Module scope
Function Scope
6.
What is meant by module?
7.
Write the output of the following program
a:=10
Disp():
a:=7
print a
Disp 1():
print a
8.
How Python represents the private and protected Access specifiers?
9.
What do you mean by Namespaces?
10.
What is a scope?
11.
Write a note on access modifiers of a class.
12.
How will you ensure the principle of data encapsulation in object - oriented programming?
13.
Why access control is required?
14.
Define Enclosed scope with an example.
15.
Define Local scope with an example.
16.
Explain the concept access control.
17.
Write any five benefits in using modular programming.
18.
Write any Five Characteristics of Modules.
19.
Explain the types of scopes for variable or LEGB rule with example.
1.
(c)
name:= object
2.
(a)
Programming languages
3.
(d)
Private members
4.
(b)
Modular programming
5.
(a)
Local Scope
6.
A module is a part of a program. Programs are composed of one or more independently developed modules
7.
The output of the program
7
10
8.
Python prescribes a convention of prefixing the name of the variable or method with single or double underscore to emulate the behavior of protected and private access specifiers.
Example: self_n2 = n2
9.
Namespaces are containers for mapping names of variables to objects.
Example : a : =5
Here the variable 'a' is mapped to the value '5.
10.
Scope refers to the visibility of variables, parameters and functions in one part of a program to another part of the same program.
11.
(i) Public members (generally methods declared in a class) are accessible from outside the class.
(ii) Protected members of a class are accessible from within the class and are also available to its sub-classes.
(iii) Private members of a class are denied access from outside the class. They can be handled only from within the class.
12.
Public members (generally methods declared in a class) are accessible from outside the class. The object of the same class is required to invoke a public method. This arrangement of private instance variables and public methods ensures the principle of data encapsulation.
13.
(i) Access control is a security technique that regulates who or what can view or use resources in a computing environment.
(ii) It is a fundamental concept in security that minimizes risk to the object.
(iii) In other words access control is a selective restriction of access to data.
(iv) In object oriented programming languages is implemented through access modifiers.
14.
(i) All programming languages permit functions to be nested. A function (method) within another function is called nested function.
(ii) A variable which is declared, inside a function which contains another function definition with in it, the inner function can also access the variable of the outer function. This scope is called enclosed scope.
(iii) When a compiler or interpreter search for a variable in a program, it first searches Local, and then searches Enclosing scopes. Consider the following example
|
1. Disp(); |
Entire program |
Output of the program 10 10 |
15.
(i) Local scope refers to variables defined in current function. Always, a function will first look up for a variable name in its local scope.
(ii) Only if it does not find it there, the outer scopes are checked.
(iii) Look at this example:
|
1. Disp(): |
Entire program |
Output of the Program 7 |
(iv) On execution of the above code the variable a displays the value 7, because it is defined and available in the local scope.
16.
(i) Access control is a security technique that regulates who or what can view or use resources in a computing environment.
(ii) It is a fundamental concept in security that minimizes risk to the object.
(iii) In other words access control is a selective restriction of access to data. IN Object oriented programming languages it is implemented through access modifiers.
(iv) Classical object-oriented languages, such as C++ and Java. control the access to class members by public, private and protected keywords.
(v) Private members of a class are denied access from the outside the class. They can be handled only from within the class.
(vi) Public members (generally methods declared in a class) are accessible from outside the class. The object of the same class is required to invoke a public method. This arrangement of private instance variables and public methods ensures the principle of data encapsulation.
(vii) Protected members of a class are accessible from within the class and are also available to its sub-classes. No other process is permitted access to it. This enables specific resources of the parent class to be inherited by the child class.
(viii) Python doesn't have any mechanism that effectively restricts access to any instance variable or method. Python prescribes a convention of prefixing the name of the variable or method with single or double underscore to emulate the behaviour of protected and private access specifiers.
(ix) All members in a Python class are public by default. whereas by default in C++ and java they are private. Any member can be accessed from outside the class environment in Python which is not possible in C++ and java.
17.
(i) Less code to be written.
(ii) A single procedure can be developed for reuse, eliminating the need to retype the code many times.
(iii) Programs can be designed more easily because a small teana deals with only a
small part of the entire code.
(iv) Modular programming allowS many programmers to collaborate on the same
application.
(v) The code is stored across multiple files.
(vi) Code is short, sirnple and easy to understand.
(vii) Errors can easily be identified, as they are localized to a subroutine or function.
(viii) The same code can be used in man applications.
(ix) The scoping of variables can easily be controlled.
18.
The following are the desirable characteristics of a module.
(i) Modules contain instructions, processing logic, and data.
(ii) Modules can be separately compiled and stored in a library.
(iii) Modules can be included in a program.
(iv) Module segments can be used by invoking a name and some parameters.
(v) Module segments can be used by other modules.
19.
Types of Variable Scope:
There are 4 types of Variable Scope, let's discuss them one by one:
Local Scope:
(i) Local scope refers to variables defined in current function. Always, a function will first look up for a variable name in its local scope. Only if it does not find it there, the outer scopes are checked.
Look at this example
| 1. Disp(): 2. a:=7 3. print a 4. Disp() |
Entire program |
Output of the Program 7 |
(ii) On execution of the above code the variable a displays the value 7, because it is defined and available in the local scope.
Global Scope:
(i) A variable which is declared outside of all the functions in a program is known as global variable.
(ii) This means, global variable can be accessed inside or outside of all the functions in a program.
Example:
| 1. a:=10 2. Disp(): 3. a:=7 4. print a 5. Disp() 6. print a |
Entire program |
Output of the Program 7 10 |
(iii) On execution of the above code the variable 'a' which is defined inside the function displays the value 7 for the function call Disp() and then it displays 10; because a is defined in global scope.
Enclosed Scope:
(i) All programming languages permit functions to be nested. A function (method) with in another function is called nested function.
(ii) A variable which is declared inside a function which contains another function definition with in it, the inner function can also access the variable of the outer function. This scope is called enclosed scope.
(iii) When a compiler or interpreter search for a variable in a program, it first search Local, and then search Enclosing scopes. Consider
the following example:
| 1. Disp(): 2. a:=10 3. Disp1() 4. print a 5. Disp1() 6. print a 7. Disp() |
Entire Program |
Output of the Program 10 10 |
(iv) In the above example Disp1( ) is defined with in Disp( ). The variable 'a' defined in Disp( ) can be even used by Disp1( ) because it is also a member of Disp( ).
Built-in Scope:
(i) The built-in scope has all the names that are pre-loaded into the program scope when we start the compiler or interpreter.
(ii) Any variable or function which is defined in the modules of a programming language has Built-in or module scope. They are loaded as soon as the library files are imported to the program.Consider the following example.
| Library files associated with the software |
LEGB rule :
The LEGB rule is used to decide the order in which the scopes are to be searched
for scope resolution. The scopes are listed below in terms of hierarchy (highest to
lowest).
.png)
12th Standard Syllabus & Materials
12th Standard
TN 12th Computer Applications களப்பெயர் முறைமை (DNS) Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications வலையமைப்பு எடுத்துக்காட்டுகள் மற்றும் நெறிமுறைகள் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications கணினி வலையமைப்பு ஓர் அறிமுகம் Sample Question Papers Study Material - QB365 Set A
NEW12th Standard
TN 12th Computer Applications PHP-உடன் MySQL-ஐ இணைத்தல் Sample Question Papers Study Material - QB365 Set A
Tamilnadu Stateboard 12th Standard Subjects

Maths

Chemistry

Physics

Biology

Computer Science

Business Maths and Statistics

Economics

Commerce

Accountancy

History

Computer Applications

Biology

Computer Technology

Computer Applications

Computer Science

Business Maths and Statistics

Commerce

Economics

Maths

Chemistry

Physics

Computer Technology

History

Accountancy

Tamil

English

French
Tamilnadu Stateboard Standards