Questions – Exam Papers – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
siteicon
Exam Paper: CBSE-Class 12th-Comp. Sc.-2017-All India (Python) siteicon No. of Q.29

Which of the following can be used as valid variable identifier(s) in Python?
(i) 4thSum
(ii) Total
(iii) Number#
(iv) Data




Name the Python Library modules which need to be imported to invoke the following functions
(i) floor()
(ii) randint()




Rewrite the following code in python after removing all syntax error(s). Underline
each correction done in the code.

STRING=""WELCOME
NOTE""
for S in range[0,8]:
    print STRING(S)
print S+STRING



Find and write the output of the following python code:

TXT   = ["20","50","30","40"]
CNT   = 3
TOTAL = 0
for C in [7,5,4,6]:
    T = TXT[CNT]
    TOTAL = float (T) + C
    print TOTAL
    CNT-=1



Find and write the output of the following python code:

class INVENTORY:
    def __init__(self,C=101,N="Pad",Q=100): #constructor
        self.Code=C
        self.IName=N
        self.Qty=int(Q);
    def Procure(self,Q):
        self.Qty = self.Qty + Q
    def Issue(self,Q):
        self.Qty -= Q
    def Status(self):
        print self.Code,":",self.IName,"#",self.Qty
I1=INVENTORY()
I2=INVENTORY(105,"Thumb Pin",50)
I3=INVENTORY(102,"U Clip")
I1.Procure(25)
I2.Issue(15)
I3.Procure(50)
I1.Status()
I3.Status()
I2.Status()



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.
import random
NAV = ["LEFT","FRONT","RIGHT","BACK"];
NUM = random.randint(1,3)
NAVG = ""
for C in range(NUM,1,-1):
    NAVG = NAVG+NAV[I]
print NAVG
(i) BACKRIGHT (ii) BACKRIGHTFRONT
(iii) BACK (iv) LEFTFRONTRIGHT



List four characteristics of Object Oriented programming.




class Exam:
   Regno=1
   Marks=75
   def __init__(self,r,m): #function 1
       self.Regno=r
       self.Marks=m
   def Assign(self,r,m): #function 2
       Regno = r
       Marks = m
   def Check(self): #function 3
       print self.Regno, self.Marks
       print Regno, Marks

(i) In the above class definition, both the functions – function 1 as well
as function 2 have similar definition. How are they different in execution?
(ii) Write statements to execute function 1 and function 2.




Define a class BOX in Python with following specifications

Instance Attributes
- BoxID   # Numeric value with a default value 101
- Side   # Numeric value with a default value 10
- Area   # Numeric value with a default value 0
Methods:
- ExecArea() # Method to calculate Area as
             # Side * Side
- NewBox() # Method to allow user to enter values of
           # BoxID and Side. It should also
           # Call ExecArea Method
- ViewBox() # Method to display all the Attributes



Differentiate between static and dynamic binding in Python? Give suitable examples of each.




Write two methods in python using concept of Function Overloading (Polymorphism) to perform the following operations:
(i) A function having one argument as Radius, to calculate Area of Circle as 3.14#Radius#Radius
(ii) A function having two arguments as Base and Height, to calculate Area of right angled triangle as 0.5#Base#Height .




What will be the status of the following list after the First, Second and Third pass of the bubble sort method used for arranging the following elements in ascending order ?
Note: Show the status of all the elements after each pass very clearly underlining the changes.
52, 42, -10, 60, 90, 20




Write definition of a method EvenSum(NUMBERS) to add those values in the list of NUMBERS, which are odd.




Write Addnew(Member) and Remove(Member) methods in python to Add a new Member and Remove a Member from a List of Members, considering them to act as INSERT and DELETE operations of the data structure Queue.




Write definition of a Method MSEARCH(STATES) to display all the state names
from a list of STATES, which are starting with alphabet M.
For example:
If the list STATES contains
[“MP”,”UP”,”WB”,”TN”,”MH”,”MZ”,”DL”,”BH”,”RJ”,”HR”]
The following should get displayed
MP
MH
MZ




Evaluate the following Postfix notation of expression:
4,2,*,22,5,6,+,/,-




Differentiate between file modes r+ and rb+ with respect to Python.




Write a method in python to read lines from a text file MYNOTES.TXT, and display
those lines, which are starting with an alphabet ‘K’.




Considering the following definition of class FACTORY, write a method in Python to search and display the content in a pickled file FACTORY.DAT, where FCTID is matching with the value ‘105’.

class Factory:
    def __init__(self,FID,FNAM):
        self.FCTID = FID # FCTID Factory ID
        self.FCTNM = FNAM # FCTNM Factory Name
        self.PROD = 1000 # PROD Production
    def Display(self):
        print self.FCTID,":",self.FCTNM,":",self.PROD


Section-C


Observe the following table MEMBER 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.

MEMBER

NO MNAME STREAM
M001 JAYA SCIENCE
M002 ADIYTA HUMANITIES
M003 HANSRAJ SCIENCE
M004 SHIVAK COMMERCE

RESULT

NO MNAME STREAM
M002 ADITYA HUMANITIES



Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii), which are based on the tables
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

(i) To display all details from the table MEMBER in descending order of ISSUEDATE.

(ii) To display the DCODE and DTITLE of all Folk Type DVDs from the table DVD

(iii) To display the DTYPE and number of DVDs in each DTYPE from the table DVD

(iv) To display all NAME and ISSUEDATE of those members from the table MEMBER who
have DVDs issued (i.e ISSUEDATE) in the year 2017

(v) SELECT MIN(ISSUEDATE) FROM MEMBER;

(vi) SELECT DISTINCT DTYPE FROM DVD;

(vii) SELECT D.DCODE,NAME,DTITLE
FROM DVD D, MEMBER M WHERE D.DCODE=M.DCODE ;

(viii) SELECT DTITLE FROM DVD
WHERE DTYPE NOT IN ( ” Folk ” , ” Classical ” );




State DeMorgan’s Laws of Boolean Algebra and verify them using truth table.




Draw the Logic Circuit of the following Boolean Expression using only NOR Gates:
( A+B).(C+D)




Derive a Canonical POS expression for a Boolean function G, represented by the following truth table:

X Y Z G(X,Y,Z)
0 0 0 0
0 0 1 0
0 1 0 1
0 1 1 0
1 0 0 1
1 0 1 1
1 1 0 0
1 1 1 1



Reduce the following Boolean expression to its simplest form using K-Map:
E(U,V,Z,W)= Ó (2,3,6,8,9,10,11,12,13)




Differentiate between communication using Optical Fiber and Ethernet Cable in context of wired medium of communication technologies.




Janish Khanna 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 different applications running on it. 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:
(i) Computer Virus
(ii) Spam Mail
(iii) Computer Bacteria
(iv) Trojan Horse




Ms. Raveena Sen is an IT expert and a freelancer. She recently used her skills to access the Admin password for the network server of Super Dooper Technology Ltd. and provided confidential data of the organization to its CEO, informing him about the vulnerability of their network security. Out of the following options (i) to (iv), which one most appropriately defines Ms.Sen? Justify the reason for your chosen option:
(i) Hacker
(ii) Cracker
(iii) Operator
(iv) Network Admin




Hi Standard Tech Training Ltd is a Mumbai based organization which is 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.


Shortest distances between various blocks/locations:

Admin Block to Account Block 300 Metres
Accounts Block to Training Block 150 Metres
Admin Block to Training Block 200 Metres
MUMBAI Head Office to CHENNAI Office 1300 KM

Number of computers installed at various blocks are as follows:

Training Block 150
Accounts Block 130
Admin Block 40

(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



Total Marks.70