Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Subject: Computer Science Class: XII Exam: Practice Paper Time Duration: 3 hrs M.M.

: 70

General Instructions:
1. This question paper contains two parts A and B. Each part is compulsory.
2. Both Part A and Part B have choices.
3. Part-A has 2 sections:
a) Section – I is short answer questions, to be answered in one word or one line.
b) Section – II has two case studies questions. Each case study has 4 case-based sub-
parts. An examinee is to attempt any 4 out of the 5 subparts.
4. Part - B is Descriptive Paper.
5. Part - B has three sections
a) Section-I is short answer questions of 2 marks each.
b) Section-II is long answer questions of 3 marks each.
c) Section-III is very long answer questions of 5 marks each.
6. All programming questions are to be answered using Python Language only

Q. PART A Marks
SECTION-I
Select the most appropriate option out of the options given for each question.
Attempt any 15 questions from question no 1 to 21.
1 Write difference between text file and Binary file in python. 1
2 Find the valid identifiers from the following 1
a) False b) First_name c) first/second d) 76number
3 A tuple is declared as 1
Tup = ( 3, 7, 9, 12, 34 )
What will be the value of sum(Tup)?
4 Given the Lists L = [2,4,7,5,9,67,1,98,56,34 ], write the output of print( L [ -1: 3 ]) 1
5 Identify the valid operator in Python from the following. 1
a) != b) or c) ? d) = >
6 Given the list L = [ ‘k’, ‘l’, ‘e’, ‘d’, ‘a’, ‘w’, ‘t’ ], write a code to check if a list 1
contains letter ‘a’.
7 Suppose a tuple T is declared as T = (2, 10, 12, 43, 39), which of the following 1
is/are incorrect?
a) T[3] = 56 b) print(max(T))
c) print(T.extend( (5,6))) d) print(len(T))
8 Name the built-in mathematical function / method that is used to return an 1
exponential value of a number.
9 Name the protocol that is used to send a file using emails. 1
10 When someone uses your personal identifying information and pretends to be you 1
in order to commit fraud or to gain other financial benefits.
Identify the type of cybercrime for these situations.
11 In SQL, name the clause that is used to remove the redundant tuples of an attribute. 1
12 In SQL, what is the use of NOT NULL constraint? 1
13 Write any one aggregate / group-by function used in SQL. 1
14 Which of the following is a DML command? 1
a) DROP b) ALTER c) DELETE d) UPDATE
You want connect your office situated in Delhi with another office in Srinagar. 1
15
Suggest the best way to do that same (in terms of transmission media).
16 Identify the valid declaration of R: 1
R = { "brand": "Ford", "model": "Mustang", "year": 1964 }

Page 1 of 7
a) dictionary b) string c) tuple d) list
17 What will be the output of the following code? 1
Str = “LearningComputerScienceUsingPython”
Print(name[ : 15: ])
18 In SQL, write the query to create a database “Employee” and display the list of 1
tables stored in the database.
19 Write the expanded form of ARPANET. 1
20 Which of the following types of constraints are valid table constraints? 1
a) Unique Key b) Foreign Key
c) Primary Key d) Candidate Key
21 Rearrange the following terms in increasing order of computer processing speed. 1
MHz, GHz, Hz, KHz
SECTION - II
Both the Case study based questions are compulsory. Attempt any 4 sub parts
from each question. Each question carries 1 mark
22 A educational institution ‘F Tech’ is considering to maintain their faculty data 5
using SQL. As a data administrator, Arun has decided that:
 Name of the database – F-Tech
 Name of the table – Faculty
 The attribute of Faculty are as follows
FCODE – CHARACTER OF SIZE 7
FNAME – CHARACTER OF SIZE 30
GENDER – CHARCTER OF SIZE 10
ROOM – NUMERIC
SUBJECT – CHARACTER OF SIZE 20
JOINDATE - DATE
FCODE FNAME Gender Room Subject JoinDate
F1001 Hari Charan Male 101 English 2000-10-11
F1004 Merry Jose Female 202 Programming 2003-11-30
F1002 Fardeen Khan Male 301 WebDesign 2001-09-06
F1005 Priya Maheshwari Female 302 WebDesign 2004-12-15
F1009 Tanya Santan Female 203 Programming 2006-12-31
F1006 Amar Anshul Male 208 DataStructure 2005-05-02

a) Identify the attribute best suitable to be declared as a primary key.


b) Write the degree and cardinality of the table of the table faculty.
c) Insert the following record in the given table
F1003, Abhinav Sharma, Male, 206, Artificial Intelligence, 2010-04-01
d) Write a command to remove the table ‘faculty’ from database ‘F-Tech’.
e) Display the structure of a table ‘Faculty’ (attributes and their respective
data type)
23 Write a menu-driven program implementing user-defined functions to perform 5
different functions on a csv file “student”. The file having fields roll number,
name, stream and marks.
(a) Name the module to be imported
(b) Name the mode in which file is to be opened
(c) Read all the records in one single go onto the csv.
(d) Write a single record to csv.
(e) Display the contents of the csv file.

Part-B
Section-I

Page 2 of 7
24 Expand the following terms: 2
a) VoIP b) XML c) TCP/IP d) W3C
25 Find and write the output of the following python code: 2
def Convert(X=45,Y=30):
X=X+Y
Y=X-Y
print X,"&",Y
return X
A=250
B=150
A=Convert(A,B)
print(A,"&",B)
B=Convert(B)
print A,"&",B
A=Convert(A)
print(A,"&",B)
26 Find and write the output of the following python code: 2
Text1="AISSCE 2018"
Text2=""
I=0
while I<len(Text1):
if Text1[I]>="0" and Text1[I]<="9":
Val = int(Text1[I])
Val = Val + 1
Text2=Text2 + str(Val)
elif Text1[I]>="A" and Text1[I] <="Z":
Text2=Text2 + (Text1[I+1])
else:
Text2=Text2 + "*"
I=I+1
print(Text2)
27 What possible outputs(s) are expected to be displayed on screen at the time of 2
execution of the program from the following code? Also specify the maximum
values that can be assigned to each of the variables START and END.

import random
SCORE=[20,40,10,30,15];
START=random.randint(1,3)
END=random.randint(2,4)
for I in range(START,END+1):
print(SCORE[I],"&")

(i) 10&40&20& (ii) 10&30&15&


(iii) 40&10&30& (iv) 20&40&10&
28 What do you understand by Referential Integrity in between tables? Give a suitable 2
example of the same from a table containing some meaningful data.
29 Differentiate between fetchone() and fetchall() methods with suitable examples for 2
each.
30 Find and write the output of the following python code: 2
TXT = ["20","50","30","40"]
CNT = 3
TOTAL = 0
for C in [7,5,4,6]:
T = TXT[CNT]
Page 3 of 7
TOTAL = float (T) + C
print(TOTAL)
CNT - =1

SECTION - II
31 What will be the status of the following list after the First, Second and Third pass 3
of the Insertion Sort method used for arranging the following elements in
descending order?
Note: Show the status of all the elements after each pass very clearly underlining
the changes.
12, 14, -54, 64, 90, 24
32 Write a method/function ISTOUPCOUNT() in python to read contents from a text 3
file WRITER.TXT, to count and display the occurrence of the word ‘‘IS’’ or
‘‘TO’’ or ‘‘UP’’.
For example :
If the content of the file is
IT IS UP TO US TO TAKE CARE OF OUR SURROUNDING. IT IS NOT
POSSIBLE ONLY FOR THE GOVERNMENT TO TAKE
RESPONSIBILITY
The method/function should display
Count of IS TO and UP is 6

OR

Write a method/function AEDISP() in python to read lines from a text file


WRITER.TXT, and display those lines, which are starting either with A or starting
with E.

For example :
If the content of the file is
A CLEAN ENVIRONMENT IS NECESSARY FOR OUR GOOD HEALTH.
WE SHOULD TAKE CARE OF OUR ENVIRONMENT. EDUCATIONAL
INSTITUTIONS SHOULD TAKE THE LEAD.
The method should display
A CLEAN ENVIRONMENT IS NECESSARY FOR OUR GOOD HEALTH.
EDUCATIONAL INSTITUTIONS SHOULD TAKE THE LEAD.
33 Find outputs for SQL queries (i) to (Iii), which are based on the tables DVD and 3
MEMBERS.
DVD
DCODE DTITLE DTYPE
F101 Henry_Martin Folk
C102 Dhrupad Classical
C101 The_Planets Classical
F102 Universal_Soldier Folk
R102 A_day_in_life Rock

MEMBER
MID NAME DCODE ISSUEDATE
101 AGAM_SINGH R102 2017-11-30
103 ARTH_JOSEPH F102 2016-12-13
102 NISHA_HANS C101 2017-07-24

Page 4 of 7
(i) SELECT DTITLE, count(*) FROM DVD GROUP BY DTYPE;
(ii) SELECT Max(ISSUEDATE),Min(ISSUEDATE) FROM MEMBER;
(iii) SELECT DTITLE, DVD.DCODE, NAME, DTYPE FROM DVD,
MEMBER WHERE DVD.DCODE = MEMBER.DCODE AND
DTYPE=”Classical”;
34 Write Insert(City) and Delete(City) methods in python to add City and Remove 3
City
considering them to act as Insert and Delete operations of the data structure
Queue.

OR

Write definition of a method EvenSum(NUMBERS) to add those values in the list


of
NUMBERS, which are odd.
35 Hi Standard Tech Training Ltd is a Mumbai based organization which is 5
expanding
its office set-up to Chennai. At Chennai office compound, they are planning to
have 3 different blocks for Admin, Training and Accounts related activities. Each
block has a number of computers, which are required to be connected in a
network for communication, data and resource sharing.
As a network consultant, you have to suggest the best network related solutions
for them for issues/problems raised by them in (i) to (iv), as per the distances
between various blocks/locations and other given parameters.

Page 5 of 7
(i) Suggest the most appropriate block/ location to house the SERVER in
the CHENNAI Office (out of the 3 blocks) to get the best and effective
connectivity. Justify your answer.
(ii) Suggest the best wired medium and draw the cable layout (Block to
Block) to efficiently connect various blocks within the CHENNAI
office compound.
(iii) Suggest a device/software and its placement that would provide data
security for the entire network of the CHENNAI office.
(iv) Suggest a device and the protocol that shall be needed to provide
wireless Internet access to all smartphone/laptop users in the
CHENNAI office.
(v) Suggest the placement of a Repeater in the network with justification.
36 Write SQL queries for (i) to (v), which are based on the tables 5

Table: VEHICLE
VCODE VEHICLETYPE PERKM
V01 VOLVO_BUS 150
V02 AC_DELUXE_BUS 125
V03 ORDINARY_BUS 80
V05 SUV 30
V04 CAR 18
Note: PERKM is Freight Charges per kilometer

Table: TRAVEL
CN CNAME TRAVELDATE KM VCODE NOP
O
101 K.Niwal 20151213 200 V01 32
103 Fredrick_Sym 20160321 120 V03 45
105 Hitesh_Jain 20160423 450 V02 42
102 Ravi_Anish 20160113 80 V02 40
107 John_Malina 20150210 65 V04 2
104 Sahanubhuti 20160128 90 V05 4
106 Ramesh_Jaya 20160406 100 V01 25
Note:
● Km is Kilometers travelled
● NOP is number of passengers travelled in vehicle

(i) To display CNO, CNAME, TRAVELDATE from the table TRAVEL in


descending order of CNO.
(ii) To display the CNAME of all the customers from the table TRAVEL who
are traveling by vehicle with code V01 or V02.
(iii)To display the CNO and CNAME of those customers from the table
TRAVEL who travelled between ‘2015‐12‐31’ and ‘2015‐05‐01’.
(iv) To display all the details from table TRAVEL for the customers, who have
travel distance more than 120 KM in ascending order of NOP.
(v) To display CNAME, TRAVELDATE, KM from the table TRVAEL where
CNAME starts with letter ‘R’.

47 A binary file “Employee.dat” has structure [EName, Ecode, salary, Department]: 5


(i) Write a user define function createfile() to imput data for a employee

Page 6 of 7
and add to Employee.dat.

(ii) Write a function SearchEmp() in python which accept the ecode as


parameter and fatch the details of employee as stored in the binary file
‘Employee.dat”.

Page 7 of 7

You might also like