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: 03/02/2021
12th Standard Computer Science English Medium Function Reduced Syllabus Important Questions With Answer Key 2021
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.
Strlen is an example________function.
user defined
impure
pure
recursive
2.
In object oriented programs, how the object is processed and executed is__________
Implementation
Interface
recursion
function
3.
In object oriented programs__________ are the interface
Implementation
parameters
Interface
Arguments
4.
A_________ combines the external interface with an implementation of the interface
parameter without type
class declaration
function definition
parameter with type
5.
All functions are________ definitions.
static
dynamic
algorithmic
static
6.
Explicitly_________the types can help with debugging.
defining
annotating
informing
computing
7.
_______are the variables in a function definition.
Arguments
Parameters
Identifiers
Operators
8.
Subroutines are called as________
Algorithm
Interface
Parameters
Function
9.
In which type of function the return type does not solely depends on its argument passed?
Pure
Parameterized
Impure
Monochromatize
10.
In which type of function the return type is solely depends on its argument passed?
pure
impure
parameterized
monochromatize
11.
Which of the following is an example of impure function?
Strlent( )
randomt( )
sqrfi( )
puref( )
12.
Which of the following is an instance created from the class?
parameter
function
subroutines
object
13.
Which of the following is a description of all functions in object oriented programming language?
Implementation
parameter
Interface
Arugument
14.
The recursive function is defined using the keyword
let
let rec
name
infer
15.
The function definition is introduced by the keyword
def
rec
let
infer
16.
Which of the following contains a set a code that works an many kinds of input and produces a concrete output?
Function
Algorithm
Arguments
Language
17.
What must the used when a bulk of statements to be repeated for many number of times?
Algorithm
Program
Subroutines
Parameters
18.
The functions which cause side effects to the arguments passed are called
Impure function
Partial Functions
Dynamic Functions
Pure functions
19.
Which of the following carries out the instructions defined in the interface?
Operating System
Compiler
Implementation
Interpreter
20.
Which of the following defines what an object can do?
Operating System
Compiler
Interface
Interpreter
21.
Which of the following is a unit of code that is often defined within a greater code structure?
Subroutines
Function
Files
Modules
22.
The small sections of code that are used to perform a particular task is called
Subroutines
Files
Pseudo code
Modules
23.
Construct on algorithm that arranges meetings between these two types so that they change their color to the third type. In the end, all should display the same color.
24.
Give an example of impure function.
25.
Give an example of pure function.
26.
What is recursive function?
27.
Give an example of function definition parameter with type.
28.
Give an example of function definition parameter without type.
29.
Differentiate parameters and arguments.
30.
Which of the following is a normal function definition and which is recursive function definition
i) let rec sum x y:
return x + y
ii) let disp:
print ‘welcome’
iii) let rec sum num:
if (num!=0) then return num + sum (num-1)
else
return num
31.
Differentiate interface and implementation.
32.
Write the inference you get from X : = (78).
33.
Define Function with respect to Programming language.
34.
What is a subroutine?
35.
Write a short note an syntax for function types.
36.
Write an algorithm to check whether the entered number is even or odd.
37.
Explain the syntax of function definitions.
38.
Wha happens if you modify a variable outside the function? Give an example.
39.
Differentiate pure and impure function.
40.
What is the side effect of impure function. Give example.
41.
Why strlen is called pure function?
42.
Mention the characteristics of Interface.
43.
Explain with an example interface and implementation.
44.
Explain with example Pure and impure functions.
45.
Identify in the following program
| let rec gcd a b:= if b <> 0 then gcd b (a mod b) else return a: |
i) Name of the function
ii) Identify the statement which tells it is a recursive function
iii) Name of the argument variable
iv) Statement which invoke the function recursively
v) Statement which terminates the recursion
46.
What are called Parameters and write a note on
(i) Parameter without Type
(ii) Parameter with Type
1.
(c)
pure
2.
(a)
Implementation
3.
(c)
Interface
4.
(b)
class declaration
5.
(a)
static
6.
(b)
annotating
7.
(b)
Parameters
8.
(d)
Function
9.
(c)
Impure
10.
(a)
pure
11.
(a)
Strlent( )
12.
(d)
object
13.
(c)
Interface
14.
(b)
let rec
15.
(c)
let
16.
(a)
Function
17.
(c)
Subroutines
18.
(a)
Impure function
19.
(c)
Implementation
20.
(c)
Interface
21.
(b)
Function
22.
(a)
Subroutines
23.
let rec monochromatize a b c :=
if a > 0 then
a, b, c:= a-1, b-1, c+2
else
a:=0, b:=0, c:= a + b + c
return c
24.
let y: = 0
(int) inc (int) x
y: =y+x;
return (y)
25.
let square x
return: x * x
let i: = 0;
ifi < strlen> (s) then
-- Do something which doesn't affect s
++i
26.
A function definition which call itself is called recursive function.
27.
(requires: b > 0 )
(returns: a to the power of b)
let rec pow (a: int) (b: int) : int :=
if (b=0) then 1
else a * pow b (a-1 )
28.
(requires: b>=0 )
(returns: a to the power of b)
let rec pow a b:=
if b=0 then I
else a * pow a (b-1)
29.
Parameters are the variables in a function definition and arguments are the values which are passed to a function definition.
30.
(i) Recursive function
(ii) Normal function
(iii) Recursive function
31.
| Interface | Implementation |
|---|---|
| Interface just defines what an object can do, but won't actually do it. | Implementation carriers out the instructions defined in the interface. |
32.
X: = (78) has an expression in it but (78) is not itself an expression. Rather, it is a function definition. Definitions bind values to names, in this case the value 78 being bound to the name 'X'.
33.
A function is a unit of code that is often defined within a greater code structure. Specifically, a function contains a set of code that works on many kinds of inputs, like variables, expressions and produces a concrete output.
34.
(i) Subroutines are the basic building blocks of computer programs. Subroutines are small sections of code that are used to perform a particular task that can be used repeatedly.
(ii) In Programming languages these subroutines are called as Functions.
35.
The syntax for function types
x\(\rightarrow \)y
x1 \(\rightarrow \)x2\(\rightarrow \)y
x1 \(\rightarrow \) .... \(\rightarrow \)x n\(\rightarrow \)y
The 'x' and 'y' are variables indicating types. The type x \(\rightarrow \) y is the type of a function that gets an input of type 'x' and returns an output of type 'y'. Where as x1\(\rightarrow \) x2 -\(\rightarrow \) y is a type of a function that takes two inputs, the first input is of type 'x1' and the second input of type 'x1', and returns an output of type 'y'. Likewise x1 \(\rightarrow \)...\(\rightarrow \)x n\(\rightarrow \)y has type 'x' as input of n arguments and 'y' type as output.
36.
(requires: x>= 0)
let rec even x :=
x=0II odd (x-I)
return 'even'
(requires: x > = 0)
let odd x :=
x< >0 && even (x-I)
return 'odd'
37.
(i) The syntax to define functions is close to the mathematical usage: the definition is introduced by the keyword let, followed by the name of the function and its arguments; then the formula that computes the image of the argument is written after an = sign. If you want to define a recursive function: use "let rec" instead of "let".
(ii) Syntax: The syntax for function definitions:
let rec fn a1 a2 ... an :;= k
(iii) Here the 'fn' is a variable indicating an identifier being used as a function name. The names 'a1' to 'an' are variables indicating the identifiers used as parameters. The keyword 'rec' is required if 'fn' is to be a recursive function; otherwise it may be omitted.
38.
The most popular groups of side effects is modifying the variable outside of function.
For example:
let y: = 0
(int) inc (int) x
y: =y+x;
return (y)
In the above example the value of y get changed inside the function definition due to which the result will change each time.
39.
| S.No | Pure Function | Impure Function |
|---|---|---|
| (i) | The return value of the pure functions solely depends on its arguments passed. | The return value of the impure functions does not solely depend on its arguments passed. |
| (ii) | If you call the pure functions with the same set of arguments, you will always get the same return values. | If you call the impure functions with the same set of arguments. You might get the different return values. |
| (iii) | They do not have any side effects. | They cause side effects. For example: random(),Date() |
| (iv) | They do not modify the arguments which are passed to them | They may modify the arguments which are passed to them |
40.
The variables used inside the function may cause side effects though the functions which are not passed with any arguments. In such cases the function is called impure function.
For example the mathematical function random() will give different outputs for the same function call.
let randomnumber :=
a := random()
if a > 10 then
return: a
else
return: 10
41.
(i) Strlen is a pure function because the function takes one variable as a parameter, and accesses it to find its length.
(ii) This function reads external memory but does not change it, and the value returned derives from the external memory accessed.
42.
(i) The class template specifies the interfaces to enable an object to be created and operated properly.
(ii) An object's attributes and behaviour is controlled by sending functions to the object.
43.
Interface:
(i) An interface is a set of action that an object can do. For example when you press a light switch, the light goes on, you may not have cared how it splashed the light. In Object Oriented Programnming language, an Interface is a description of all functions.
(ii) In our example, anything that "ACTS LIKE" a light, should have function definitions like turn_on () and a turn_off (). The purpose of interfaces is to allow the Computer to enforce the properties of the class.
Implementation:
(i) Implementation carries out the instructions defined in the interface.
(ii) How the object is processed and executed is the implementation.
(iii) A class declaration combines the external interface (its local state) with an implementation of that interface (the code that carries out the behaviour).
For example, let's take the example of increasing a car's speed.

(iv) The person who drives the car doesn't care about the internal working. To increase the speed of the car he just presses the accelerator to get the desired behaviour. Here the accelerator is the interface between the driver (the calling / invoking object) and the engine ( the called object).
(v) In this case, the function call would be speed (70):, this is the interface Internally, the engine of the car is doing all the things but fuel, air, pressure, and electricity come together to create the power to move the vehicle.
(vi) All of these actions are separated from the driver, who just wants to go faster. Thus we separate interface from implementation.
44.
Pure functions:
(i) Pure functions are functions which will give exact result when the same arguments are passed.
(ii) For example the mathematical function sin (0) always results 0. This means that every time you call the function with the same arguments, you wil always get the same result.
(iii) A function can be a pure function provided it should not have any external variable which will alter the behavior of that variable.
let us see an Example:
Let square x : =
return: x * x
(iv) The above function square is a pure function because it will not give different results for same input.
(v) There are various theoretical advantages of having pure functions. One advantage is that if a function is pure, then if it is called several times with the same arguments, the compiler only needs to actually call the function once.
Example:
let length s:=
i:= 0
let i:= 0;
if i<strlen (s) then
-- Do something which doesn't affect s
++1
(vi) If it is compiled, strlen (s) is called each time and strlen needs to iterate over the whole of 's'. If the compiler is smart enough to work out that strlen is a pure function and that 's' is not updated in the loop, then it can remove the redundant extra calls to strlen and make the loop to execute only one time.
(vii) From these what we can understand, strlen is a pure function because the function takes one variable as a parameter, and accesses it to find its length. This function reads external memory but does not change it, and the value returned derives from the external memory accessed
Impure functions:
(i) The variables used inside the function may cause side effects through the functions which are not passed with any arguments. In which cases the function is called impure function.
(ii) When a function depends on variable or functions outside of its definition block, you can never be sure that the function will behave the same every time it's called. For example, the mathematical functions random ( ) will give different outputs for the same function call.
Example:
let randomnumber:=
a := random()
if a > 10 then
return: a
else
return: 10
(iii) Here the function Random is impure as it is not sure what will be the result when we call the function
45.
(i) gcd
(ii) let rec gcd
(iii) a, b
(iv) gcd(a mod b)
(v) return a
46.
Parameters and arguments:
Parameters are the variable in a function definition and arguments are the values which are passed to a function definition
(i) Parameter without Type: Let us see an example of a function,definition :
(requires: b >=0 )
(returns: a to the power of b)
let rec pow a b:=
if b=0 then 1
else a*powa(b-1)
(i) In the above function definition variable 'b' is the parameter and the value which is passed to the variable 'b' is the argument. The precondition (requires) and postcondition (returns) of the function is given.
(ii) Note we have not mentioned any types (data types). Some language computer solves this type (data type) inference problem algorithmically, but some require the type to be mentioned.
(iii) In, the above function deinition if expression can return 1 in the then branch, shows that as per the typing rule the entire if expression has type int
(iv) Since the if expression is of type 'int', the function's return type also be int. 'b' is compared to 0 with the equality operator. so 'b' is also a type of int: Since 'a' is multiplied with another expression using the operator, 'a' must be an int.
(ii) Parameter with Type: Now let us write the same function definition with types for some reasons:
(requires: b > 0 )
(returns: a to the power of b )
let rec pow (a:int) (b:int): int :=
if b=0 then 1
n else a * pow b (a-1)
(i) When we write the type annotations for ‘a’ and ‘b’ the parentheses are mandatory. Generally, we can leave out these annotations, because it's simpler to let the compiler infer them.
(ii) There are times we may want to explicitly write down types. This is useful on times when you get a type error from the compiler that doesn't make sense. Explicitly annotating the types can help with debugging such an error message.
(iii) The syntax to define functions is close to the mathematical usage: the definition is introduced by the keyword let followed by the name of the function and its arguments; then the formula that computes the image of the argumentis written atter an := sign. If you want to define a recursive function: use "let rec" instead of "let"
Syntax:The syntax for function detinitions: let irec fn al a2 ... an := k
(iv) Here the 'fn' is used as a function name. The nanmes 'a1' to 'an'are variables used as parameters. The keyword 'rec' is required if 'fn' is to be a recursive function; otherwise it may be omitted.
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