CSSC 2022-Class Xii-Csc-Qp
CSSC 2022-Class Xii-Csc-Qp
CSSC 2022-Class Xii-Csc-Qp
COMMON EXAMINATION
CLASS XII
COMPUTER SCIENCE (083)
Time : 3 hours Maximum Marks:70
General Instructions
❖ This Question paper contains 14 printed pages.
❖ This Question paper contains 35 Questions.
❖ Write down the question number before attempting.
❖ An additional reading time of 15 minutes.
General Instruction to answer this Question paper
1. This Question paper contains Five Sections, Section A to E.
2. All Question are compulsory.
3. Section A have 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer Type Questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is given in
Q34 against part (iii) only.
8. All Programming questions are to be answered using python language only.
SECTION A
Page 1 of 14
5. Write the output for the following python snippet. 1
LST=[1,2,3,4,5,6]
for i in range(6):
LST[i-1]=LST[i]
print(LST)
6. Out of the following file mode which opens the file and delete all its contents 1
and place the file pointer at the beginning of the file.
(a) a (b) w (c) r (d) a+
7. (a) In an SQL table, if the primary key is combination of more than one 1
field, then it is called as _____________.
(b) _________ command is used to make an existing column as a primary
key.
10. In MYSQL _____ clause applies the condition on every ROW and ______ 1
clause applies the condition on every GROUP.
11. Complete the following snippet to open the file and create a writer object for 1
a csv file “emp.csv” with delimiter as pipe symbol ‘|’ to add 5 more records
into the file using the list named “e_rec”.
emp_file=___________
csv_writer=csv.writer( ____________ )
Page 2 of 14
13. Name any two protocols used for video conferencing. 1
15. Which command is used to display the structure of the table? Write the 1
syntax of the command.
16. Which function of mysql.connector library lets you check if the connection 1
to the database is established or not?
(a) connectionobject.is_connected()
(b) mysql.connector,connect()
(c) mysql.connector()
(d) mysql.connector
17. Assertion(A) : 1
When we open the file in write mode the content of the file will be erased if
the file already exist.
Reasoning(R):
Open function will create a file if does not exist, when we create the file both
in append mode and write mode.
18. Assertion(A): 1
Keyword argument were the named arguments with assigned values being
passed in the function call.
Reasoning (R):
Default arguments cannot be skipped while calling the function while
keyword arguments are in function call statement.
SECTION B
19. Mr. Gupta wants to print the city he is going to visit and the distance to 2
reach that place from his native. But his coding is not showing the correct
Page 3 of 14
output debug the code to get the correct output and state what type of
argument he tried to implement in his coding.
def Travel(c,d)
print(“Destination city is “,city)
print(“Distance from native is “,distance)
Travel(distance=”18 KM”,city=”Tiruchi”)
22. What is the difference between Equi join and Natural join? Give an Example 2
Page 4 of 14
L1[i]=L1[i]%10
L=[100,212,310]
print(L)
Quo_Mod(L)
print(L)
OR
What possible outputs are expected to be displayed on screen at the time of
execution of the program from the following code? Also specify the
maximum value that can be assigned to each of the variables L and U.
import random
Arr=[10,30,40,50,70,90,100]
L=random.randrange(1,3)
U=random.randrange(3,6)
for i in range(L,U+1):
print(Arr[i],"@",end="")
(i) 40 @50 @ (ii) 10 @50 @70 @90 @
(iii) 40 @50 @70 @90 @ (iv) 40 @100 @
25. What is the difference between column constraint and table constraint? Give 2
an example.
OR
What is the difference between LIKE and IN operator in MYSQL. Give an
example.
SECTION C
26. (a) Consider the following tables FACULTY and STUDENT. Write the 3
output for the MYSQL statement given below and state what type of join
is implemented.
SELECT * FROM FACULTY,STUDENT
FACULTY STUDENT
Faculty_Id Name
Stu_id Stu_Name
F100 Govardhan
12101 Anitha
F101 Janet
12102 Vishnu
F102 Rithu
Page 5 of 14
(b) Write the output for the queries (i) to (iv) based on the table given
below.
SPOTRS
Page 6 of 14
Example:
Eshwar returned from office and had a cup of tea.
Veena and Vinu were good friends.
Anusha lost her cycle.
Arise! Awake! Shine.
The function must give the output as:
Number of Lines begins and ends with a vowel is 3
28. (a) Write the SQL Queries for (i) to (iii) based on the table EMPLOYEE 3
and DEPARTMENT.
EMPLOYEE
DEPARTMENT
DEPT_ID D_NAME
101 Production
102 Sales
103 Marketing
Page 7 of 14
29. Write a function DIVI_LIST() where NUM_LST is a list of numbers passed 3
as argument to the function. The function returns two list D_2 and D_5 which
stores the numbers that are divisible by 2 and 5 respectively from the
NUM_LST.
Example:
NUM_LST=[2,4,6,10,15,12,20]
D_2=[2,4,6,10,12,20]
D_5=[10,15,20]
● Push the keys (name of the student) of the dictionary into a stack, where
the corresponding value (CS marks) are more than or equal to 90 .
● Pop and display the content of the stack, if the stack is empty display the
message as “UNDER FLOW”
For example: If the sample content of the dictionary is as follows:
CS={"Raju":80, "Balu":91, "Vishwa":95, "Moni":80, “Govind":90}
The push operatio’s output from the program should be:
Balu Vishwa Govind
The pop operation must display
Govind
Vishwa
Balu
“UNDER FLOW”
OR
Dev Anand have a list of 10 numbers. You need to help him create a program
with separate user defined functions to perform the following operations
based on this list.
● Traverse the content of the list and push the numbers divisible by 5 into
the stack.
● Pop and display the content of the stack, if the stack is empty display the
message” STACK EMPTY”
For Example:
If the sample Content of the list is as follows:
N=[2,5,10,13,20,23,45,56,60,78]
After the push operation the list must contain
Page 8 of 14
5,10,20,45,60
And pop operation must display the output as
60
45
20
10
5
STACK EMPTY
Block Computers
Conference 25
Finance 60
Page 9 of 14
(a) Suggest the most appropriate block where the organization should plan
to install their server?
(b) Draw a block-to-block cable layout to connect all the buildings in the
most appropriate manner for efficient communication.
(c) What will be the best possible connectivity out of the following to
connect the new set-up of offices in Chennai with its London base office?
(i) Infrared (ii) Satellite Link (iii) Ethernet Cable
(d) Which of the following devices will you suggest to connect each
computer in each of the above buildings?
(i) Gateway (ii) Switch (iii) Modem
(e ) Suggest a device/software to be installed for data security in the campus.
32. (a) Find the output for the following python code: 2+3
def LST_ARG(L1):
L2=L1
L3=[0,0,0,0]
print("L2->",L2)
print("L3->",L3)
j=0
L1.append(51)
for i in range(len(L1)):
if L1[i]%5==0:
L2[j]=L2[j]*L2[j]
L3[j]=L2[j]%5
j+=1
print("L1->",L1)
print("L2->",L2)
print("L3->",L3)
L1=[10,15,20]
LST_ARG(L1)
print("L1->",L1)
(b) The Python program establishes connection between python and mysql,
and display the students details where the marks were between 80 to 90.
Write the missing statement to complete the code.
Page 10 of 14
Statement 1 – to check whether connection is not established.
Statement 2 – to create cursor object.
Statement 3 – to retrieve all the data from the cursor object.
import mysql.connector
conn=mysql.connector.connect(host="localhost",user="root",passwd="123
45",database="student")
if______________ # Statement 1
print("Error connecting to MYSQL DATABASE")
________________ # Statement 2
c.execute("select * from student where marks>80 and marks<90")
_____________ # Statement 3
count=c.rowcount
print("total no of rows:",count)
for row in r:
print(row)
OR
(a) Find the output for the following python code :
def OUTER(Y,ch):
global X,NUM
Y=Y+X
X=X+Y
print(X,"@",Y)
if ch==1:
X=inner_1(X,Y)
print(X,"@",Y)
elif ch==2:
NUM=inner_2(X,Y)
def inner_1(a,b):
X=a+b
b=b+a
print(a,"@",b)
return a
def inner_2(a,b):
X=100
Page 11 of 14
X=a+b
a=a+b
b=a-b
print(a,"@",b)
return b
X=100
NUM=1
OUTER(NUM,1)
OUTER(NUM,2)
print(NUM,"@",X)
(b) Consider the following Python code is written to access the details of
employee, whose employee number is given:
Complete the missing statements:
Statement 1 – To create a cursor object to execute the query.
Statement 2 – To execute the query stored in the variable change.
Statement 3 – To make the changes in the database physically.
def Search():
import mysql.connector
mydb=mysql.connector.connect(host="localhost",user="root",
passwd="system",database="DB")
_______________ # Statement 1
change="update employee set salary=salary+5000 where empno=
1011"
_______________ # Statement 2
______________ # Statement 3
results = mycursor.fetchall()
print(results)
33. What is the use of seek() function ? Write a python program that defines and 5
calls the following user defined functions.
Add_book() – To read the details of the books from the user and write into
the csv file named “book.csv”. The details of the books stored in a list are
book_no,name,author.
Search_book() - To read the author name from the user and display the books
written by the author.
OR
Page 12 of 14
How to open the file using with statement? Write a python program that
defines and calls the user defined functions given below.
Add_rating() – To read product name and rating from the user and store the
same into the csv file “product.csv”
Display() – To read the file “product.csv” and display the products where the
rating is above 10.
SECTION E
34. Naveen created a table SALES_DONE to maintain the sales made by his
sales department. The table consists of 10 employees records. To record 1+1+2
every months sales he is adding a new column with first three characters of
that month.
Page 13 of 14
35. Mrs.Renu wrote a python program to update the salary of the employee by 4
reading the employee number. She got some errors while executing the
program so she deleted those lines. As a python programmer guide her to fill
the missing statements.
_____________ # Statement 1
def modify():
e=[ ]
____________ # Statement 2
found=False
T_eno=int(input("enter employee no"))
try:
while True:
____________ # Statement 3
e=pickle.load(f)
if e[0] == T_eno:
e[2]=float(input("enter new salary"))
f.seek(pos)
__________ # Statement 4
found=True
except:
f.close()
if found==True:
print("employee record found and updated")
else:
print("employee record not found and updating not possible")
“End of Paper”
Page 14 of 14