12th Std Computer Science Question Papers
12th Std Computer Science Question Papers
th Reg. No.
PTA Model question paper - 1
part - III
Time Allowed : 3.00 Hours] COMPUTER SCIENCE [Maximum Marks : 70
PART - I
Note : (i) Answer all the questions. 15×1=15
(ii) Choose the most appropriate answer from the given four alternatives and write the option code and the cor-
responding answer.
1. A function definition which call itself :
(a) Pure function (b) Impure function
(c) Normal function (d) Recursive function
2. Expansion of ADT :
(a) Abstract Data Tuple (b) All Data Template
(c) Abstract Data Type (d) All Data Type
3. A variable which is declared inside a function which contains another function definition :
(a) Local (b) Global
(c) Enclosed (d) Built-in
4. Time complexity of bubble sort in best case is
(a) θ (n) (b) θ (nlogn)
(c) θ (n2) (d) θ (n(logn) 2)
5. Which operator is also called as Comparative operator?
(a) Arithmetic (b) Relational
(c) Logical (d) Assignment
6. What will be the output of the following python code?
for i in range(1, 10, 2):
print(i, end=’ ‘)
(a) 1 3 5 7 9 (b) 1 2 4 6 8
(c) 2 4 6 8 10 (d) 1 3 5 7 10
7. Which function is called anonymous function?
(a) Lambda (b) Recursion
(c) Function (d) define
8. Which of the following is the slicing operator?
(a) { } (b) [ ] (c) < > (d) ( )
9. If List = [17, 23, 41, 10] then [Link](32) will result
(a) [32,17,23,41,10] (b) [17,23,41,10,32]
(c) [10,17,23,32,41] (d) [41,32,23,17,10]
10. Which of the following method is used as destructor?
(a) __init__( ) (b) __dest__( )
(c) __rem__( ) (d) __del__( )
11. A column in database table is known as an :
(a) Attribute (b) Relation
(c) Tuple (d) Data
Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers 35
sum = 0
while i < 4:
sum+=Marks[i]
i+=1
PART - IV
Answer all the questions: 5 × 5 = 25
34. (a) Explain LEGB rule with example.
(OR)
(b) Discuss about Linear Search Algorithm.
35. (a) Explain the different operators in Python.
(OR)
(b) Explain briefly about Jump statements in Python.
36. (a) Explain the set operations supported by python with suitable example.
(OR)
(b) Find the output of the following Python code
class Sample:
num=0
def __init__(self, var):
[Link]+=1
[Link]=var
print(“The object value is = “, var)
print(“The count of object created = “, [Link])
S1=Sample(15)
S2=Sample(35)
S3=Sample(45)
37. (a) Explain the types of relationships used in a database.
(OR)
(b) Explain about the TCL commands with suitable examples.
38. (a) Write a Python code to display all the records of the following table using fetchmany().
[Link] Name Marks
3001 Chithirai 353
3002 Vaigasi 411
3003 Aani 374
3004 Aadi 289
3005 Aavani 507
3006 Purattasi 521
(OR)
(b) Write a Python Script to display the following Pie chart.
Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers 37
PART - I
1. (d) Recursive function
2. (c) Abstract Data Type
3. (c) Enclosed
4. (a) θ (n)
5. (b)
Relational
6. (a) 1 3 5 7 9
7. (a) Lambda
8. (b) [ ]
9. (b) [17,23,41,10,32]
10. (d) __del__( )
11. (a) Attribute
12. (d) Revoke
13. (d) DictReader ()
14. (a) __name__
15. (a) Matplotlib
38 Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers
th Reg. No.
PTA Model question paper - 2
part - III
Time Allowed : 3.00 Hours] COMPUTER SCIENCE [Maximum Marks : 70
PART - I
Note : (i) Answer all the questions. 15×1=15
(ii) Choose the most appropriate answer from the given four alternatives and write the option code and the cor-
responding answer.
1. The variables in a function definition are called as
(a) Subroutines (b) Function
(c) Definition (d) Parameters
2. The data type whose representation is unknown is called.
(a) Built in datatype (b) Derived datatype
(c) Concrete datatype (d) Abstract datatype
3. Which of the following is used in programming languages to map the variable and object?
(a) :: (b) := (c) = (d) ==
4. Step by step procedure for solving a given problem:
(a) Program (b) Pseudo Code
(c) Flowchart (d) Algorithm
5. What will be the value of X from the following code snippet?
A, B = 10, 3
X = A if (A/B==3) else B
print(X)
(a) 3 (b) 10 (c) True (d) False
6. Which is not a jump statement?
(a) for (b) goto
(c) continue (d) break
7. Which of the following special character is used to define variable length arguments?
(a) & (b) $ (c) * (d) #
8. What is stride?
(a) index value of slice operation (b) first argument of slice operation
(c) second argument of slice operation (d) third argument of slice operation
9. Let setA ={3, 6, 9}, setB={1,3,9}. What will be the result of the following snippet? print(setA|setB)
(a) {3,6,9,1,3,9} (b) {3,9}
(c) {1} (d) {1,3,6,9}
10. Which of the following is the private class variable?
(a) __num (b) ##num
(c) $$num (d) &&num
11. What symbol is used for SELECT statement?
(a) σ (b) Π (c) X (d) Ω
Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers 39
if (ch in (‘A’, ‘a’, ‘e’, ‘E’, ‘i’, ‘l’, ‘o’, ‘O’, ‘u’, ‘U’)):
[Link]+=1
def count_consonants(self):
for ch in [Link]:
if (ch not in (‘A’, ‘a’, ‘e’, ‘E’, ‘i’, ‘l’, ‘o’, ‘O’, ‘u’, ‘U’)):
[Link] +=1
def count_space(self):
for ch in [Link]:
if (ch==””):
[Link]+=1
def execute(self):
self.count_upper()
self.count_lower()
self.count_vowels()
self.count_consonants()
self.count_spaces()
def display(self):
print(“The given string contains...”)
print(“%d Uppercase letters”%[Link])
print(“%d Lowercase letters”%[Link])
print(“%d Vowels”%[Link])
print(“%d Consonants”%[Link])
print(“%d Spaces”%[Link])
S = String()
[Link]()
[Link]()
[Link]()
37. (a) Explain the following operators in Relational algebra with suitable examples.
(1) Union (∪)
(2) Intersection (∩)
(OR)
(b) Consider the following employee table. Write SQL commands for the questions.(1) to (5).
EMP CODE NAME DESIG PAY ALLOWANCE
S1001 Hariharan Supervisor 29000 12000
P1002 Shaji Operator 10000 5500
42 Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers
(OR)
(b) Write the syntax for getopt() and explain its arguments and return values.
PART - I
1. (d) Parameters
2. (d) Abstract datatype
3. (c) =
4. (d) Algorithm
5. (d) False
6. (a) for
7. (c) *
8. (d) third argument of slice operation
9. (d) {1,3,6,9}
10. (a) __num
11. (a) σ
12. (d) TRANCATE
13. (b) xls
14. (c) execute
15. (d) [Link]()
Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers 43
th Reg. No.
PTA Model question paper - 3
part - III
Time Allowed : 3.00 Hours] COMPUTER SCIENCE [Maximum Marks : 70
PART - I
Note : (i) Answer all the questions. 15×1=15
(ii) Choose the most appropriate answer from the given four alternatives and write the option code and the cor-
responding answer.
1. The function which will give exact result then same arguments are passed are called :
(a) Impure function (b) Partial Function
(c) Dynamic Function (d) Pure function
2. Which are loaded as soon as the library files are imported to the program?
(a) Built-in scope variables (b) Enclosed scope variables
(c) Global scope variables (d) Local scope variables
3. Which of the following is not a characteristic of an algorithm?
(a) Input (b) Program
(c) Finiteness (d) Simplicity
4. In how many ways programs can be written in Python?
(a) Two (b) Three
(c) Four (d) Five
5. What will be the output of the following Python snippet?
a=15
while (a<=20):
print(a%a, end=’ ’)
i=i+1
(a) 15 16 17 18 19 20 (b) 20 19 18 17 16 15
(c) 0 0 0 0 0 0 (d) 1 1 1 1 1 1
6. Which keyword to be used to define a function in Python?
(a) def (b) local
(c) rec (d) global
7. Which command can be used to remove entire string variable in Python?
(a) rem (b) remove
(c) del (d) delete
8. Which function is used to find length of a list in Python?
(a) for() (b) range()
(c) len() (d) length
9. In Python the class method must have which named argument as first argument?
(a) self (b) rec
(c) global (d) key
44 Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers
(OR)
PART - I
1. (d) Pure functions
2. (a) Built-in scope variables
3. (b) Program
4. (a) Two
5. (a) 15 16 17 18 19 20
6. (a) def
7. (c) del
8. (c) len()
9. (a) self
10. (c) table
11. (d) Rollback
12. (b) x
13. (a) [Link]
14. (a) SELECT
15. (d) SQLite
Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers 47
th Reg. No.
PTA Model question paper - 4
part - III
Time Allowed : 3.00 Hours] COMPUTER SCIENCE [Maximum Marks : 70
PART - I
Note : (i) Answer all the questions. 15×1=15
(ii) Choose the most appropriate answer from the given four alternatives and write the option code and the cor-
responding answer.
1. Which of the following are mandatory to write the type annotations in the function definition?
(a) { } (b) ( ) (c) [ ] (d) < >
2. Bundling two values together into one can be considered as
(a) Pair (b) Triplet (c) Single (d) Quadrat
3. This is a theoretical performance analysis of an algorithm :
(a) Priori estimates (b) Posteriori testing
(c) Space factor (d) Time factor
4. Which of the following statement(s) is not correct?
(1) Python is a general purpose programming language which can be used for both scientific and non-scientific
programming.
(2) Python is a platform independent programming language.
(3) The programs written in Python are difficult to read and understand.
(a) Statement (1) Only (b) Statement (1) and (2)
(c) Statement (3) Only (d) All statements
5. Match the following :
(a) if...elif - (i) Jump
(b) while - (ii) Block
(c) pass - (iii) Loop
(d) indentation - (iv) Branching
(a) (a)-(iv), (b)-(iii), (c)-(i), (d)-(ii) (b) (a)-(i), (b)-(iii), (c)-(iv), (d)-(ii)
(c) (a)-(iv), (b)-(i), (c)-(iii), (d)-(ii) (d) (a)-(i), (b)-(iv), (c)-(ii), (d)-(iii)
6. Non-keywords variable arguments are called as
(a) Sets (b) List
(c) Tuples (d) Dictionary
7. Which of the following is used as placeholders or replacement fields which get replaced along with format( )
function?
(a) { } (b) < > (c) ++ (d) ^^
8. Which Function is used to generate a series of values in Python?
(a) series() (b) range()
(c) list() (d) tuple()
9. The function defined inside a class is called as ______.
(a) Attribute (b) Parameter
(c) Arguments (d) Methods
48 Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers
PART - III
Answer any six questions. Question No. 33 is compulsory. 6 × 3 = 18
25. Write a function that finds the minimum of its three arguments.
26. How do you facilitate data abstraction?
27. Write the pseudo code for linear search.
28. Write a short note on :
(i) id () (ii) type ( ) (iii) chr ( )
29. Mention the difference between fetchone() and fetchmany().
30. How do you define constructor and destructor in Python?
31. Write a short note on Unary Relational Operations of DBMS.
32. How [Link]() function is used to create a normal CSV file in Python?
33. What will be the output of the following Python program?
str1 = “welcome”
str2 = “to school”
str3 = str1[:3]+str2[len(str2)-1:]
print(str3)
PART - IV
Answer all the questions: 5 × 5 = 25
34. (a) What are modules? What are its characteristics?
(OR)
(b) Write the pseudo code for selection sort algorithm.
35. (a) Explain about while loop in Python with suitable example.
(OR)
(b) Explain type of function arguments in Python with suitable examples.
36. (a) Explain the following string functions with suitable examples.
(i) center () (ii) find ()
(OR)
(b) What will be the output of the following Python program?
N = []
for x in range(1, 11):
[Link](x)
Num=tuple(N)
print(Num)
for index, i in enumerate(N):
if(i%2==1):
del N[index]
print(N)
37. (a) Explain the types of relationships used in database.
50 Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers
(OR)
(b) Explain about DML commands of SQL
38. (a) Write a Python program to store and retrieve the following data in SQLite3.
Database Schema:
Field Type Size Constrain
Rollno INTEGER PRIMARY KEY
Sname VARCHAR 20
Gender CHAR 1
Average DECIMAL 5, 2
Data to be inserted as tuple :
Rollno Sname Gender Average
1001 KULOTHUNGAN M 75.2
1002 KUNDAVAI F 95.6
1003 RAJARAJAN M 80.6
1004 RAJENDRAN M 98.6
1005 AVVAI F 70.1
(OR)
(b) What are the key differences between Histogram and Bar graph?
PART - I
1. (b) ()
2. (a) Pair
3. (a) Priori estimates
4. (c) Statement (3) Only
5. (a) (a)-(iv), (b)-(iii), (c)-(i), (d)-(ii)
6. (c) Tuples
7. (a) { }
8. (b) range()
9. (d) Methods
10. (b) one-to-many
11. (a) DDL
12. (b) skipinitialspace
13. (a) __name____
14. (c) Cursor
15. (b) Scatter
Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers 51
th Reg. No.
PTA Model question paper - 5
part - III
Time Allowed : 3.00 Hours] COMPUTER SCIENCE [Maximum Marks : 70
PART - I
Note : (i) Answer all the questions. 15×1=15
(ii) Choose the most appropriate answer from the given four alternatives and write the option code and the cor-
responding answer.
1. Which of the following algorithmic approach is similar to divide and conquer approach?
(a) Insertion sorting (b) Dynamic programming
(c) Selection searching (d) Bubble programming
2. ADT can be implemented using ________
(a) singly linked list (b) doubly linked list
(c) either A or B (d) neither A nor B
3. Which of the following is not the example of modules?
(a) procedures (b) subroutines
(c) class (d) functions
4. The floor division operator in Python:
(a) / (b) % (c) % % (d) //
5. The optional parameter of range() function in Python
(a) start (b) stop (c) step (d) slice
6. What will be the output of the following Python snippet?
c=5
def add():
c=c+5
print(c)
add()
(a) 5 (b)10 (c) 15 (d) Error
7. The formatting character is used to print exponential notation in upper case?
(a) %e (b) %E (c) %g (d) %n
8. Which is a mutable and unordered collection of elements without duplicates?
(a) List (b) Tuple
(c) Set (d) Dictionary
9. The class instantiation means :
(a) Creating a class (b) Creating a constructor
(c) Creating a Destructor (d) Creating an object
10. The symbol of project in relational algebra of DBMS :
(a) σ (b) П (c) ∩ (d) ∪
52 Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers
(b) accetnum(n1)
(c) displaynum(n1)
(d) eval(a/b)
(e) x,y: = makeslope (m), makeslope(n)
(f) display()
26. What are the different phases of analysis and performance evaluation of an algorithm?
27. Write a Python program to print the following pattern.
A
AB
ABC
ABCD
ABCDE
28. How index value allocated to each character of a string in Python?
29. Write any three uses of data visualization.
30. Explain Cartesian product with a suitable example.
31. What is the difference between the write mode and append mode?
32. Read the following details. Based on that write a python script to display department wise records
Database name : [Link]
Table name : Employee
Columns in the table : Eno, EmpName, Esal, Dept
33. Write a simple python program with list of five marks and print the sum of all the marks using while loop.
PART - IV
Answer all the questions: 5 × 5 = 25
34. (a) 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
(OR)
(b) Explain the characteristics of an algorithm.
35. (a) Explain recursive function in Python with an example.
(OR)
(b) Write a note on find ( ) function in Python.
36. (a) What will be the output of the following Python program?
A={x*3 for x in range (1,6)}
B={y**2 for y in range (1,10, 2)}
Print(A)
54 Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers
Print(B)
Print(A|B)
Print(A-B)
Print(A&B)
Print(A˄B)
(OR)
(b) Explain the characteristics of DBMS.
37. (a) Write the rules to be followed to format the data in a CSV file.
(OR)
(b) Write the syntax for getopt() and explain its arguments and return values.
38. (a) What is the use of HAVING clause? Give an example python script.
(OR)
(b) Explain the various buttons in a matplotlib window.
PART - I
1. (b) Dynamic programming
2. (a) singly linked list
3. (c) class
4. (d) //
5. (d) slice
6. (d) Error
7. (b) %E
8. (c) Set
9. (d) Creating an object
10. (b) П
11. (b) a-iv, b-i, c-ii, d-iii
12. (b) DictReader
13. (b) Modular programming
14. (a) DISTINCT
15. (b) line()
Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers 55
th Reg. No.
PTA Model question paper - 6
part - III
Time Allowed : 3.00 Hours] COMPUTER SCIENCE [Maximum Marks : 70
PART - I
Note : (i) Answer all the questions. 15×1=15
(ii) Choose the most appropriate answer from the given four alternatives and write the option code and the cor-
responding answer.
1. Which of the following is a distinct syntactic block?
(a) Subroutines (b) Function
(c) Definition (d) Modules
2. Which of the following does not allow to name the various parts of a multi-item object?
(a) Tuples (b) Lists
(c) Classes (d) quadrats
3. The members that are accessible from within the class and are also available to its sub-classes is called
(a) Public members (b) Protected members
(c) Secured members (d) Private members
4. The word comes from the name of a Persian mathematician Abu Ja’far Mohammed ibn-i Musa al Khowarizmi is
called?
(a) Flowchart (b) Flow
(c) Algorithm (d) Syntax
5. Which of the following character is used to give comments in Python Program?
(a) # (b) & (c) @ (d) $
6. Which of the following is not a jump keyword?
(a) pass (b) continue
(c) skip (d) break
7. Which of the following is not an argument type?
(a) Required arguments (b) Default arguments
(c) Keyword arguments (d) Fixed length arguments
8. What will be the output of the following snippet?
str1= “COMPUTER”
print(str1[::2])
(a) ER (b) CO (c) OPTR (d) CMUE
9. How may elements are in the list given below?
MyList=[78, 91, 34, [32, 61, 85], 65]
(a) 3 (b) 4 (c) 5 (d) 7
10. Which of the following class declaration is correct?
(a) class class_name (b) class class_name<>
(c) class class_name: (d) class class_name[ ]
56 Sura’s ➠ 12th Std COMPUTER SCIENCE Question Papers
PART - I
1. (c) Definition
2. (b) Lists
3. (b) Protected members
4. (c) Algorithm
5. (a) #
6. (c) skip
7. (d) Fixed length arguments
8. (c) OPTR
9. (d) 7
10. (c) class class_name:
11. (b) row
12. (b) UPDATE
13. (c) Python filename
14. (a) sqlite_master
15. (a) Markers