XII Computer Science SET I QP
XII Computer Science SET I QP
General Instructions:
● This question paper contains 37 questions.
● All questions are compulsory. However, internal choices have been provided in some questions.
Attempt only one of the choices in such questions
● The paper is divided into 5 Sections- A, B, C, D and E.
● Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
● Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
● Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
● Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
● Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
● All programming questions are to be answered using Python Language only.
● In case of MCQ, text of the correct answer should also be written.
Page 1 of 9
5. What will be correct output for the following: 1
R = (4.5, 5), (5,4), (8.2,7), (8,7,3)
print(max(R))
A. Error B. (8.2, 7)
C. (8, 7, 3) D. (4.5, 5, 8.2, 8)
6. Select the correct output of the following code: 1
S = "Motivational thought"
print(S.find("hou", 4, 13))
A. True B. 4
C. 14 D. -1
7. Which of the following statement(s) would give an error after executing the 1
following code ?
A. Statement-2 B. Statement-3
C. Statement-4 D. Statement-2 and 4
8. What does the list.append(x) method do in Python? 1
A. Inserts the element x at the beginning of the list
B. Inserts the element x at the end of the list
C. Inserts the element x in between two elements in the list
D. It merges the two lists and creates another list
9. If a table which has one Primary key and two alternate keys. How many 1
Candidate keys will this table have?
A. 1 B. 2 C. 3 D. 4
10. Write the missing statement to complete the following code: 1
f = open("Essay.txt", "r")
data = f.read(80)
cur_pos = ______ # Get the current position of the file pointer
print(“Current position is: ”, cur_pos)
f.close()
11. State True or False: 1
The try block in Python can contain multiple except blocks to handle
different types of exceptions.
12. What will be the output of the following code? 1
p=6
def Demo():
global p
p**=2
print(p, end='+')
Demo()
print(p, end='@')
Page 2 of 9
A. 6+36@
B. 72@
C. 36+36@
D. 36+6@
13. Fill in the blanks: 1
The SELECT statement when combined with __________ clause, returns
records without repetition.
14. Which function in SQL is used to count the total number of records 1
regardless of NULL from table in a database?
A. sum(*) B. total(*)
C. count(*) D. count( )
15. The degree and cardinality of a table named SONG are 2 and 4, respectively. 1
The degree and cardinality of another table named SINGER are 3 and 5,
respectively. There is one common field in both tables. After performing the
Cartesian product of both tables, what will be the new degree and
cardinality of the resultant table?
A. 4 and 20 B. 5 and 20
C. 5 and 9 D. 4 and 9
16. A result set is extracted from the database using a cursor object by giving 1
the following statement:
records=mycursor.fetchall( )
What will be the data type of records,after the execution of above
statement?
A. tuple B. string
C. dictionary D. list
17. Which of the following protocols is used for remote login: 1
A. VoIP B. HTTP
C. IMAP D. TELNET
18. _________ is used for point-to-point communication or unicast 1
communication such as radar and satellite.
A. Infrared B. Bluetooth
C. Microwaves D. Radio waves
19. Which network device converts digital data from a computer into analog 1
signals for transmission over phone lines?
Q.20 and Q.21 are Assertion(A) and Reason(R) based questions. Mark
the correct choice as:
A. Both A and R are true and R is the correct explanation for A
B. Both A and R are true and R is not the correct explanation for A
C. A is True but R is False
D. A is False but R is True
20. Assertion (A): The return statement in a Python function is optional. 1
Reason (R): If no return statement is used, the function returns None by
default.
21. Assertion (A): In SQL, the GROUP BY clause is used to arrange identical 1
data into groups.
Reason (R): The GROUP BY clause is mandatory when using aggregate
functions like SUM() or AVG().
Page 3 of 9
SECTION-B ( 7 x 2=14 Marks)
22. Define dynamic data typing in python. Write an example to illustrate 2
your answer.
23. i. Define Operator Associativity. 2
ii. Write the following operators in descending order (Higher precedence
to lower precedence in order of operation) of their operator
precedence:
or, **, and, +, *, ==
24. If M1=[60,25,30,……] and M2=[3,6,9,12, …….], then 2
Write the Python statements for each of the following tasks using Built-in
functions/methods only:
i.
A. To delete an element 25 from the list M1.
OR
B. Write a statement to add an element 85 in the list M2 between the
elements 9 and 12.
ii.
A. Write a statement to sort the elements of list M1 in descending
order.
OR
B. Write the statement to delete the last element of list M2.
25. Look at the following python code and find the possible output(s) from the 2
options (i) to (iv) following it. Also, write the highest and lowest values that
can be pointed by label VALUE.
import random
for y in range(4):
VALUE = random.randrange(4,11) + y
print(VALUE, "#", end=" ")
i. 6 # 7 # 12 # 13 # ii. 5 # 11 # 8 # 11 #
iii. 4 # 7 # 12 # 14 # iv. 9 # 15 # 8 # 6 #
26. The code provided below is intended to search an element from a list. 2
However, there are syntax and logical errors in the code. Rewrite the
code in python after removing all error(s). Underline each correction done
in the code.
def Linear_Search(L)
item=int(input("Enter the value that you want to search: ")
for i in range(len(L)):
if L[i]==item:
print("Element found at index: " i)
break
else:
print("Element not found")
Linear_Search([25,78,45,36,21,10])
27. i. 2
A. What constraint should be applied on a table column so that NULL is
not allowed in that column, but duplicate values are allowed.
OR
B. Categorize the following commands as DDL and DML:
INSERT, UPDATE, ALTER, DROP
Page 4 of 9
ii.
OR
Write the output of the code given below:
def FindOutput(p, q=2, r=40):
x=p**2*4
y=x+r
print(x, "@", y)
return y
c=FindOutput(q=5, r=7,p=4)
a,b=4,3
c=FindOutput(b,a,c)
print(a,"@",b,"@",c)
Section-D ( 4 x 4 = 16 Marks)
32. Consider a table TRAIN as given below: 4
TNo TName Train_Type Source Destination Fare
12001 Rajdhani Express Superfast Delhi Mumbai 3000
12625 Shatabdi Express Superfast Delhi NULL 1200
12501 North East Express Express Guwahati Delhi 1500
16159 Kanyakumari Exp Express Kanyakumari Delhi 2500
20814 Jodhpur-Puri Exp Express Jodhpur Puri 2800
19412 Sabarmati Express Express Sabarmati NULL 1100
Table : BORROWER
customer_name loan_number
Ajit Das L456
Rohan Yadav L901
Suman Verma L123
Ayesha Tiwari L987
Saurav L347
Page 7 of 9
35. Alok wants to create a table named BOOK in the LIBRARY database, which 4
should have the following structure:
Jaipur Campus
HR Tech
nical
Head Office
Mark
eting
Mumbai
Page 8 of 9
Distance between various building blocks:
HR BLOCK to TECHNICAL BLOCK 45 m
HR BLOCK to MARKETING BLOCK 98 m
TECHNICAL BLOCK to MARKETING BLOCK 107 m
Head Office to JAIPUR Campus 1275 KM
i. Suggest the most appropriate location of the server inside the JAIPUR
campus (out of the 3 blocks), to get the best connectivity for
maximum number of computers. Justify your answer.
ii. Which among the following devices will you suggest to be procured
by the company for connecting all the computers within each of their
offices?
● Switch/Hub
● Modem
● Bridge
iii. Suggest network type (out of LAN, MAN, WAN) for connecting each
of the following set of their offices:
a. HR and Marketing Block
b. Head Office and Jaipur office
v.
A. In JAIPUR Campus, in between which offices repeater should be
installed? Justify the answer.
OR
B. Suggest and draw the cable layout to efficiently connect various
blocks within the JAIPUR campus for connecting the computers.
Page 9 of 9