CBSE-XII - Computer Science 2017 (Delhi)
CBSE-XII - Computer Science 2017 (Delhi)
m
question paper only and will not write any answer on the answer-book during this period.
co
COMPUTER SCIENCE a.
Time allowed : 3 hours Maximum marks : 70
di
General Instructions :
(i) Programming Language in SECTION A : C++.
in
91/1 1 [P.T.O.
SECTION – B
(Only for Candidates, who opted for Python)
1. (a) Which of the following can be used as valid variable identifier(s) in Python ? 2
(i) total
(ii) 7Salute
(iii) Que$tion
(iv) global
(b) Name the Python Library modules which need to be imported to invoke the
following functions : 1
(i) ceil()
(ii) randint()
(c) Rewrite the following code in Python after removing all syntax error(s). Underline
each correction done in the code. 2
TEXT=""GREAT
m
DAY""
for T in range[0,7]:
co
print TEXT(T)
print T+TEXT a.
(d) Find and write the output of the following Python code : 2
STR = ["90","10","30","40"]
di
COUNT = 3
SUM = 0
in
for I in [1,2,5,4]:
S = STR[COUNT]
SUM = float (S)+I
er
print SUM
COUNT–=1
e
ar
(e) Find and write the output of the following Python code : 3
class ITEM:
def_init_(self,I=101,N="Pen",Q=10): #constructor
.c
self.Ino=I
self.IName=N
w
self.Qty=int(Q);
def Buy(self,Q):
w
self.Qty = self.Qty + Q
w
def Sell(self,Q):
self.Qty –= Q
def ShowStock(self):
print self.Ino,":",self.IName,"#",self.Qty
91/1 9 [P.T.O.
I1=ITEM()
I2=ITEM(100,"Eraser",100)
I3=ITEM(102,"Sharpener")
I1.Buy(10)
I2.Sell(25)
I3.Buy(75)
I3.ShowStock()
I1.ShowStock()
I2.ShowStock()
(f) What are the possible outcome(s) executed from the following code ? Also specify
the maximum and minimum values that can be assigned to variable N. 2
import random
SIDES=["EAST","WEST","NORTH","SOUTH"];
N=random.randint(1,3)
m
OUT=""
for I in range(N,1,–1):
OUT=OUT+SIDES[I]
co
print OUT
(i) SOUTHNORTH (ii) SOUTHNORTHWEST
a.
(iii) SOUTH (iv) EASTWESTNORTH
di
def_init_(self,r,m): #function 1
re
self.rollno=r
self.marks=m
a
marks = m
def check(self): #function 3
w
print self.rollno,self.marks
print rollno,marks
w
(i) In the above class definition, both the functions – function 1 as well as
w
91/1 10
(c) Define a class RING in Python with following specifications : 4
Instance Attributes
- RingID # Numeric value with a default value 101
– Radius # Numeric value with a default value 10
– Area # Numeric value
Methods :
– AreaCal() # Method to calculate Area as
# 3.14*Radius*Radius
– NewRing() # Method to allow user to enter values of
# RingID and Radius. It should also
# Call AreaCal Method
m
– ViewRing() # Method to display all the Attributes
(d) Differentiate between static and dynamic binding in Python ? Give suitable
co
examples of each. 2
(e) Write two methods in Python using concept of Function Overloading
a.
(Polymorphism) to perform the following operations : 2
di
(i) A function having one argument as side, to calculate Area of Square as
side*side
rin
(ii) A function having two arguments as Length and Breadth, to calculate Area of
Rectangle as Length*Breadth.
e
3. (a) What will be the status of the following list after the First, Second and Third pass
re
of the bubble sort method used for arranging the following elements in descending
order ? 3
a
Note : Show the status of all the elements after each pass very clearly underlining
.c
the changes.
152, 104, –100, 604, 190, 204
w
(b) Write definition of a method OddSum(NUMBERS) to add those values in the list
w
(c) Write Addnew(Book) and Remove(Book) methods in Python to Add a new Book
and Remove a Book from a List of Books, considering them to act as PUSH and
POP operations of the data structure Stack. 4
91/1 11 [P.T.O.
(d) Write definition of a Method AFIND(CITIES) to display all the city names from a
list of CITIES, which are starting with alphabet A. 2
For example :
["AHMEDABAD","CHENNAI","NEW DELHI","AMRITSAR","AGRA"]
AHMEDABAD
AMRITSAR
AGRA
m
(e) Evaluate the following Postfix notation of expression : 2
2,3,*,24,2,6,+,/,–
co
a.
4. (a) Differentiate between file modes r+ and w+ with respect to Python. 1
di
(b) Write a method in Phyton to read lines from a text file DIARY.TXT, and display
those lines, which are starting with an alphabet ‘P’. 2
rin
class Company:
a
def_init_(self,CID,NAM):
.c
self.Turnover = 1000
w
def Display(self):
print self.CompID,":",self.CName,":",self.Tunover
91/1 12
SECTION – C
(For all the Candidates)
5. (a) Observe the following table CANDIDATE carefully and write the name of the
RDBMS operation out of (i) SELECTION (ii) PROJECTION (iii) UNION
(iv) CARTESIAN PRODUCT, which has been used to produce the output as
shown in RESULT. Also, find the Degree and Cardinality of the RESULT. 2
TABLE : CANDIDATE
NO NAME STREAM
C1 AJAY LAW
C2 ADITI MEDICAL
m
C3 ROHAN EDUCATION
co
C4 RISHAV ENGINEERINGa.
RESULT
NO NAME
di
C3 ROHAN
rin
(b) Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii),
e
TABLE : BOOK
91/1 13 [P.T.O.
TABLE : MEMBER
MNO MNAME CODE ISSUEDATE
M101 RAGHAV SINHA L102 2016-10-13
M103 SARTHAK JOHN F102 2017-02-23
M102 ANISHA KHAN C101 2016-06-12
(i) To display all details from table MEMBER in descending order of
ISSUEDATE.
(ii) To display the BNO and BNAME of all Fiction Type books from the table
BOOK.
(iii) To display the TYPE and number of books in each TYPE from the table
BOOK.
(iv) To display all MNAME and ISSUEDATE of those members from table
MEMBER who have books issued (i.e. ISSUEDATE) in the year 2017.
(v) SELECT MAX(ISSUEDATE) FROM MEMBER;
(vi) SELECT DISTINCT TYPE FROM BOOK;
m
(vii) SELECT A.CODE,BNAME,MNO,MNAME
FROM BOOK A, MEMBER B WHERE A.CODE=B.CODE;
co
(viii) SELECT BNAME FROM BOOK
WHERE TYPE NOT IN ("FICTION","COMIC");
a.
6. (a) State Distributive Laws of Boolean Algebra and verify them using truth table. 2
di
(b) Draw the Logic Circuit of the following Boolean Expression using only NAND
Gates : 2
rin
X.Y + Y.Z
(c) Derive a Canonical SOP expression for a Boolean function F, represented by the
following truth table : 1
e
U V W F(U,V,W)
re
0 0 0 1
0 0 1 0
a
0 1 0 1
.c
0 1 1 1
w
1 0 0 0
1 0 1 0
w
1 1 0 1
w
1 1 1 0
(d) Reduce the following Boolean Expression to its simplest form using K-Map : 3
F(X,Y,Z,W) = Σ(0,1,2,3,4,5,10,11,14)
91/1 14
7. (a) Differentiate between Radio Link and Microwave in context of wireless
communication technologies. 2
(b) Amit used a pen drive to copy files from his friend’s laptop to his office computer.
Soon his office computer started abnormal functioning. Sometimes it would restart
by itself and sometimes it would stop functioning totally. Which of the following
options out of (i) to (iv), would have caused the malfunctioning of the computer ?
Justify the reason for your chosen option : 2
(i) Computer Worm
(ii) Computer Virus
(iii) Computer Bacteria
(iv) Trojan Horse
(c) Jai is an IT expert and a freelancer. He recently used his skills to access the
Administrator password for the network server of Megatech Corpn Ltd. and
provided confidential data of the organization to its Director, informing him about
the vulnerability of their network security. Out of the following options (i) to (iv),
m
which one most appropriately defines Jai ? 2
Justify the reason for your chosen option :
co
(i) Hacker
(ii) Cracker
(iii) Operator
a.
(iv) Network Admin
di
(d) Hi Speed Technologies Ltd. is a Delhi based organization which is expanding its
office setup to Chandigarh. At Chandigarh office campus, they are planning to have
rin
3 different blocks for HR, Accounts and Logistics related work. Each block has
number of computers, which are required to be connected in a network for
communication, data and resource sharing.
e
As a network consultant, you have to suggest the best network related solutions for
re
them for issues/problems raised in (i) to (iv), keeping in mind the distances
between various blocks / locations and other given parameters.
a
.c
w
w
w
91/1 15 [P.T.O.
Shortest distances between various blocks/locations :
HR Block 70
Accounts Block 50
Logistics Block 40
(i) Suggest the most appropriate block/location to house the SERVER in the
m
CHANDIGARH Office (out of the 3 blocks) to get the best and effective
connectivity. Justify your answer. 1
co
(ii) Suggest the best wired medium and draw the cable layout (Block to Block) to
efficiently connect various Blocks within the CHANDIGARH office
a.
compound. 1
di
(iii) Suggest a device / software and its placement that would provide data
security for the entire network of CHANDIGARH office. 1
rin
(a) PAN
re
(b) WAN
(c) MAN
a
.c
(d) LAN
___________
w
w
w
91/1 16