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: 29/06/2019
12th Standard New Syllabus Chapter One Important Question
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.
The function definition is introduced by the keyword
def
rec
let
infer
2.
The functions which will give exact result when same arguments are passed are called
Impure functions
Partial Functions
Dynamic Functions
Pure functions
3.
Which of the following carries out the instructions defined in the interface?
Operating System
Compiler
Implementation
Interpreter
4.
The variables in a function definition are called as
Subroutines
Function
Definition
Parameters
5.
6.
Which of the following is a unit of code that is often defined within a greater code structure?
Subroutines
Function
Files
Modules
7.
The small sections of code that are used to perform a particular task is called
Subroutines
Files
Pseudo code
Modules
8.
Give an example of function definition parameter without type.
9.
Differentiate parameters and arguments.
10.
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
11.
Differentiate interface and implementation.
12.
Write the inference you get from X : = (78).
13.
What is a subroutine?
14.
Write a short note an syntax for function types.
15.
Write an algorithm to check whether the entered number is even or odd.
16.
Explain the syntax of function definitions.
17.
Mention the characteristics of Interface.
18.
Explain with an example interface and implementation.
19.
Explain with example Pure and impure functions.
20.
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
1.
(c)
let
2.
(d)
Pure functions
3.
(c)
Implementation
4.
(d)
Parameters
5.
(c)
6.
(b)
Function
7.
(a)
Subroutines
8.
(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)
9.
Parameters are the variables in a function definition and arguments are the values which are passed to a function definition.
10.
(i) Recursive function
(ii) Normal function
(iii) Recursive function
11.
| 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. |
12.
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'.
13.
(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.
14.
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.
15.
(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'
16.
(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.
17.
(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.
18.
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.
19.
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
20.
(i) gcd
(ii) let rec gcd
(iii) a, b
(iv) gcd(a mod b)
(v) return a
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