Computer Science (083) - Practice Paper-2 - QP
Computer Science (083) - Practice Paper-2 - QP
(General Instructions)
Please check that this question paper contains 12 printed pages.
Please check that this question paper contains 37 questions.
Please write down the serial number of the question before attempting it.
Reading time of 15 minutes is given to read the question paper alone. No writing during
this time.
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.
PRACTICE PAPER-2
Class-12
(COMPUTER SCIENCE – 083]
Page 1 of 12
4 Write the output. 1
a="youareGoodstudent"
print(a.split())
print(a.split('e'))
5 Write the output. 1
Names="ILoveIndia"
print(Names[-1:-8:-2])
6 What will be the output of the following code? 1
TT=[10,20,30]
PP=TT
TT += [40,50]
print(PP==TT)
a) None b) False c) True d) Error
7 Which of the following will delete key-value pair for key=”Red” from a dictionary D1?
a) Delete D1(“Red”)
b) del D1[“Red”]
c) del.D1[“Red”]
d) D1.del[“Red”]
8 Choose correct output/stack contents for the following sequence of operations. 1
[Note: Initially stack is empty, Find the stack content after execution]
push(5)
push(8)
pop()
push(2)
push(5)
pop()
push(1)
a)8 5 2 5 1 b)8 5 5 2 1 c)5 2 1 d)2 5 5 1
9 Fill in the blank. 1
The SELECT statement when combined with __________ clause, returns records
without repetition.
a) DESCRIBE b) UNIQUE c) DISTINCT d)NOT NULL
10 What will be the output of the following code if the content of the file “ smile.txt” is: 1
Smiling is infectious,
You catch it like the flu.
When someone smiled at me today,
I started smiling too.
Page 2 of 12
file = open(“smile.txt”)
content = file.read()
print(file.read(7))
file.close()
def Games():
try:
print(“try Silver”,end=’ ‘)
finally:
print(“finally Gold”,end=’ ‘)
#main
Games()
13 To reflect the changes made in the database permanently, you need to run <connection> 1
_____________ method.
a)done() b)reflect() c)final() d)commit()
14 With SQL, how do you select all the records from a table named “Persons” where the value 1
of the column “FirstName” ends with an “a”?
a) SELECT * FROM Persons WHERE FirstName=’a’
b) SELECT * FROM Persons WHERE FirstName LIKE ‘a%’
c) SELECT * FROM Persons WHERE FirstName LIKE ‘%a’
d) SELECT * FROM Persons WHERE FirstName=’%a%’.
Page 3 of 12
17 Identify the network which extends a private network across a public network. 1
a)Storage Area network
b)Local area network
c)Enterprise Private network
d)Virtual private network
18 The new web standard that incorporates AI, ML(Machine Learning) and black chain to 1
the internet is ________________.
23 List all the operators used in the following program. Name the operator types under Python. 2
x=2
y=3
change('e',x,y)
Page 4 of 12
24 I) D is a dictionary. 2
D = {"apple": 15, "banana": 7, "cherry": 9,"orange":84}
Answer the following questions using built functions/dictionary functions only.
A) Write the statement to remove all the items from the dictionary ‘D’.
OR
B) Write the statement to sort the values in ascending order of dictionary ‘D’.
II) T is a Tuple.
T = ("banana", "cherry", "orange", ”apple” )
Answer the following questions using built functions/tuple functions only.
A) Write the statement to sort values in descending order.
OR
B) Write the statement to count number of elements present in tuple ‘T’.
25 Based on the following code, answer the following question. 2
import random
AR=[20,30,40,50,60,70]
FROM=random.randint(1,3)
TO=random.randrange(2,5)
for K in range(FROM,TO+1):
print (AR[K],end=”#“)
What possible outputs(s) are expected to be displayed on screen at the time of execution
of the above program? Also write the maximum and minimum value of variable ‘TO’.
a) 10#40#70# b) 50#60#70#
c) 40#50#70# d) 30#40#50#
26 The code provided below is intended to swap alternate elements of a given List. 2
However, there are syntax and logical errors in the code. Rewrite it after removing all
errors. Underline all the corrections made.
def swap_alternate(tup)
for i in range(0,len(tup),2)
tup[i],tup[i+1]=tup[i+1],tup[i]
return
II)
A)Write the output.
a=20
def logic(a):
b=20
a=a+b
logic(10)
print("a=", a)
OR
B)Write the output.
a=10
def call():
global a
a=15
b=20
call()
print("a=", a)
28 A)Name the topology. List one advantage and one disadvantage of it. 2
OR
b)Expand the term TCP/IP.What is the use of TCP/IP.
Page 6 of 12
SECTION – C [3x3=9 Marks]
29 Write function Count_Robot() in python to read a text file “Moon.txt” and count the 3
number of times the word “robot “(all cases) occurs in the file.
OR
Write a function Filter() that copies a text file “source.txt” into “target.txt” barring the
lines starting with a “@” sign.
Each of these records are nested together to form a nested list. Write the following user
defined functions in Python to perform the specified operations on the stack named
travel.
i) Push_element(NList): It takes the nested list as an argument and pushes a list object
containing name of the city and country, which are not in India and distance is less than
3500 km from Delhi.
ii) Pop_element(): It pops the objects from the stack and displays them. Also, the
function should display “Stack Empty” when there are no elements in the stack.
OR
Write a menu driven program to add, delete and display the record of Hostel using
list as stack data structure in Python. Record of hostel contains the fields: Hostel
number, Total students and Total Rooms.
Page 7 of 12
31 Predict the output of the following code: 3
D={1: "One", 2: "Two", 3: "Three"}
D.setdefault(4,"Fourty")
D.setdefault("Twenty")
print(D)
L=[ ]
for i,j in D.items( ):
if j!=None and j[0]== "T":
L.append(i)
print (L)
print(D.get(1,"not found"))
print(D.get(10,"not found"))
print(D.update({2:200}))
OR
Predict the output of the following code:
data=["L",20,"M",40,"N",60]
times,alpha,add=0,"",0
for c in range(1,6,4//2):
times = times + c
alpha = alpha + data [c-1] + "@"
add = add + data[c]
print (times, add, alpha)
SECTION-D ( 4 x 4 = 16 Marks)
32 Consider the table customer as given below. 4
Table: Customer
Note: The table contains many more records than shown here.
Page 8 of 12
3)To find and print the maximum, minimum purchase amount of each gender.
4)To increase the discount with 12% of purchase amount of all female customers.
OR
B) Write the output.
1)Select cname, pur_amt from customer where net between 30000 and 45000
order by cname;
2)Select gender, avg(discount) from customer group by gender having count(*)>2;
3)Select cname, pur_amt, net from customer where cname like ‘J%e’ order by net desc;
4)Select gender, max(pur_amt), min(net) from customer group by gender ;
33 Rohan is making a software on “Countries & their Capitals” in which various records are 4
to be stored/retrieved in CAPITAL.csv data file. It consists some records (Country &
Capital). Help him to define and call the following user defined functions:
i) AddNewRec() – To accept and add the records to a CSV file “CAPITAL.csv”. Each
record consists of a list with field elements as Country and Capital to store country name
and capital name respectively.
ii) ShowRec() – To display all the records having country name starting with “I” present
in the CSV file named ‘CAPITAL.csv’.
Passenger
Tcode pname Gender Age phone
102 Arun Male 45 9834334343
104 Balakumar Male 11 7678987654
107 Ritu Female 35 9889454567
101 Banu Female 43 8001232338
104 Gopichand Male 65 7898565656
1. To display travel code, source, destination, name and age of all travelers whose
age is>=20 and <=40.
Page 9 of 12
2. To display travel code, customer name, fare amount and discount. The discount
is 10% of travel fare.
3. To count the number of male and number of female travelers who are travelling
from Chennai to Delhi whose age is>60 separately.
4. To increase the fare amount by 10% of actual fare for all male travelers whose
destination is either Mumbai or Delhi.
OR
To display all passenger name, age and phone number of travelers who are
travelling from Chennai to Delhi in alphabetical order of name.
35 The code given below inserts the following record in the table Student: 4
RollNo – integer
Name – string
Class2 – integer
Marks – integer
• The details (RollNo, Name, Class and Marks) are to be accepted from the user.
Write the following Python function to perform the specified operation:
i) Interface_Insert(): To input details of N items and store it in the table Student.
ii)Interface_Show()-The function should retrieve all the records from Student table and
display the records who are studying in class 12 and marks more than 60.
Assume the following for Python-Database connectivity:
Host: localhost, User: root, Password: tiger, Database: school.
[Note: Accept the values from user, A Senior Citizen is a resident Indian who is of the
age of 60 years and above]
Page 10 of 12
37 An International Bank has to set up its new data center in Delhi, India. It has five blocks 5
of buildings – A, B, C, D and E.
Distance between the blocks and number of computers in each block are as given below:
Number of Computers
Block A 55
Block B 180
Block C 60
Block D 55
Block E 70
(i) Suggest the most suitable place/block to host the server. Justify your answer.
(ii) Draw the cable layout (Block to Block) to economically connect various
blocks within the Delhi campus of International Bank.
(iii) Suggest the placement of the following devices with justification:
(a) Repeater (b) Hub/Switch
(iv)The bank is planning to connect it’s another head office in London. Which type of
network out of LAN, MAN, or WAN will be formed? Justify your answer.
Page 11 of 12
(v)
A) What would be your recommendation for enabling live visual communication
between the Admin Office at the Mumbai campus and the DELHI Office (Block B) from
the following options:
i) Video Conferencing
ii) Email
iii) Telephony
iv) Instant Messaging
OR
B)How can unauthorized access in a network be stalled? Name a hardware/software to
be installed in your computer to work for this reason.
Page 12 of 12