Pyq 1987
Pyq 1987
Pyq 1987
CLASS- XII
Time: 3hrs COMPUTER SCIENCE (083) Max. Marks: 70
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions 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 Q35
against part c only.
8. All programming questions are to be answered using Python Language only.
SECTION-A
(1 mark to be awarded for every correct answer)
01 Write the names of the following Tokens of Python : 1
(i) if (ii) roll_no
02 Identify the valid Logical operator in Python from the following. 1
(a) OR (b) != (c) in (d) and
03 Suppose a tuple T is declared as T = (25, 37, 58, 79), which of the following is 1
incorrect?
a) print(T[1]) b) T[2] = –96
c) print(max(T)) d) print(len(T))
15 Which of the following aggregate function does not ignore nulls in its results? 1
(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
SECTION-B
19 Saroj has written a Python code . His code is having errors. Rewrite the correct 2
code and underline the corrections made.
def evaluate( ) :
Value=30
for val in range(0,Value)
If val%4==0:
print (VAL*4)
Elseif val%5=0:
print (VAL+3)
else
print(VAL+10)
20 Write two points of difference between Circuit Switching and Packet Switching. 2
OR
Write two points of difference between Hackers and Crackers.
(b) Which protocol helps us to transfer files to and from a remote computer?
“OR”
“OR”
SECTION-C
26 (a) Consider the following tables – Customer and City: (01) 3
Table: Customer
CID CNAME AMOUNT
1001 Mukesh 5000
1002 Kailash 4500
1003 Nitesh 6000
Table : City
CID CITY
1001 Rourkela
1002 Bhubaneswar
1001 Cuttack
What will be the output of the following statement?
SELECT * FROM Customer NATURAL JOIN City ;
(b)Write the outputs of the SQL queries (i) to (iv) based on the table given below:
(02)
28 (a) Write the outputs of the SQL queries (i) to (iv) based on the relations 3
TRAINER and COURSE given below:
30 Manoj has a list containing 10 integers. You need to help him create a program 3
with separate user defined functions to perform the following operations based on
this list.
● Traverse the content of the list and push the even numbers into a stack.
● Pop and display the content of the stack.
For Example:
If the sample Content of the list is as follows:
N=[12, 13, 34, 56, 21, 79, 98, 22, 35, 38]
Sample Output of the code should be:
38 22 98 56 34 12
“OR”
Julie has created a dictionary containing names and marks as key value pairs of 6
students. Write a program, with separate user defined functions to perform the
following operations:
● Push the keys (name of the student) of the dictionary into a stack, where the
corresponding value (marks) is greater than 75.
● Pop and display the content of the stack.
For example:
If the sample content of the dictionary is as follows:
R={"Niki":76, "Manu":45, "Bilu":89, "Ani":65, "Kanu":90, "Hok":82}
The output from the program should be:
NikiBiluKanuHok
SECTION-D
31 5
Intelligent Hub India is a knowledge community aimed to uplift the standard
of skills and knowledge in the society. It is planning to setup its training
centers in multiple towns and villages pan India with its head offices in the
nearest cities. They have created a model of their network with a city, a town
and 3 villages as given.
As a network consultant, you have to suggest the best network related solution
for their issues/problems raised in (i) to (v) keeping in mind the distance
between various locations and given parameters.
Shortest distance between various locations:
Note:
• In Villages, there are community centers, in which one room has been given
as training center to this organization to install computers.
• The organization has got financial support from the government and top IT
companies.
32 (a) Predict the output of the Python code given below: (02) 2+3=
5
def Diff(N1,N2):
if N1>N2:
return N1-N2
else:
return N2-N1
NUM= [10,23,14,54,32]
for CNT in range (4,0,-1):
A=NUM[CNT]
B=NUM[CNT-1]
print(Diff(A,B),'#', end=' ')
(b) The code given below inserts the following record in the table Employee:
EmpNo – integer (03)
EmpName – string
EmpDesig – string
EmpSalary – float
Note the following to establish connectivity between Python and MYSQL:
Username is „root‟
Host name is „localhost‟
Password is „dav@123‟
The table exists in a MYSQL database named STORE.
The details (EmpNo, EmpName, EmpDesig,EmpSalary) are to be accepted
from the user.
“OR”
(a) Find and write the output of the following python code: (02)
Msg1="WeLcOME"
Msg2="GUeSTs"
Msg3=""
for I in range(0,len(Msg2)+1):
if Msg1[I]>="A" and Msg1[I]<="M":
Msg3=Msg3+Msg1[I]
elif Msg1[I]>="N" and Msg1[I]<="Z":
Msg3=Msg3+Msg2[I]
else:
Msg3=Msg3+"*"
print (Msg3)
(b) Meena wants to see all the records from the Traders table. (03)
Write the following missing statements to complete the code:
Statement 1 – to form the cursor object
Statement 2 – to execute the query that extracts records .
Statement 3 – to read the complete result of the query .
import mysql.connector as db
mycon=db.connect(host=”localhost”,user=”system”,password=”test”,datab
ase=”Admin”)
cursor=___________________# statement 1
sql=”SELECT * FROM Traders “
______________________ # Statement 2
data=__________________ # Statement 3
for dt in data:
print(dt)
mycon.close()
b. CSVRead() : to display the records from the CSV file called BOOKS.CSV
where the field title starts with 'R'.
“OR”
Give any one point of difference between a binary file and a text file.
Write a Program in Python that defines and calls the following user defined
functions:
b) SEARCH()- To display the records of the items whose price is more than
25000.
SECTION-E
34 1+1+
2
=4
(c) and answer the questions (a) and (b)
He has succeeded in writing partial code and has missed out certain statements,
so he has left certain queries in comment lines. You as an expert of Python have
to provide the missing statements and other related queries based on the
following code of Amritya.
Answer the below mentioned questions.
import _______________ # Statement 1
def AddStudents():
____________ # Statement 2 to open the binary file to write data
while True:
Rno = int(input("Rno :"))