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.-2015-Delhi (Python) siteicon No. of Q.32

How is _init( ) _different from _del ( ) _ ?




Name the function/method required to
(i) check if a string contains only uppercase letters
(ii) gives the total length of the list.




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

def Tot(Number) #Method to find Total
    Sum=0
    for C in Range (l, Number+l):
        Sum+=C
RETURN Sum

print Tot[3]    #Function Calls
print Tot[6]



Find and write the output of the following python code :

for Name in ['Jayes', 'Ramya', 'Taruna','Suraj']:
    print Name
    if Name[0]== 'T':
        break
    else :
        print 'Finished!'
    print 'Got it!'



Find and write the output of the following python code:

class Worker :
    def_init_(self,id,name): #constructor
        self.ID=id
        self.NAME=name
    def Change (self) :
        self.ID=self.ID+10
        self.NAME='Harish'
    def Display(self,ROW) :
        print self.ID,self.NAME,ROW
w=Worker(55,'Fardeen')
w.Display(l)
w.Change( )
w.Display(2)
print w.ID+len(w.NAME)



What are the possible outcome(s) executed from the following code? Also specify the maximum and minimum values that can be assigned to variable NUMBER.

STRING="CBSEONLINE"
NUMBER=random.randint(0,3)
N=9
while STRING[N]!='L':
    print STRING[N]+STRING[NUMBER]+'#',
    NUMBER=NUMBER + 1
    N=Nl
(i)         (ii)        (iii)       (iv)
ES#NE#IO#   LE#NO#ON#   NS#IE#LO#   EC#NB#IS#



Illustrate the concept inheritance with the help of a python code




What will be the output of the following python code ? Explain the try and except used in the code.

U=0
V=6
print 'First'
try:
    print 'Second'
    M=V/U
    print 'Third',M
    except ZeroDivisionError :
        print V*3
        print 'Fourth'
    except:
        print V*4
        print 'Fifth'



Write a class PICTURE in Python with following specifications: Instance Attributes

- Category # String value
- Location # Exhibition Location with String value
Methods:
- FixLocation() # A method to assign Exhibition
                # Location as per Category as
                # shown in the following table
Category Location
Classic Amina
Modern Jim Plaq
Antique Ustad Khan

– Enter() # A function to allow user to enter values # Pno, Category and call FixLocation() method – SeeAll() # A function to display all the data members




What is operator overloading with methods? Illustrate with the help of an example using a python code.




Write a method in python to display the elements of list thrice if it is a number and display the element terminated with ‘#’ if it is not a number.

For example, if the content of list is as follows:
ThisList=['41','DROND','GIRIRAJ','13','ZARA']
414141
DROND#
GIRlRAJ#
131313
ZARA#



What will be the status of the following list after fourth pass of bubble sort and fourth pass of selection sort used for arranging the following elements in descending order ?
14, 10, -12, 9, 15, 35




Write a method in python to search for a value in a given list (assuming that the elements in list are in ascending order) with the help of Binary Search method. The method should return ]1 if the value not present else it should return position of the value present in the list.




Write PUSH (Books) and POP (Books) methods in python to add Books and remove Books considering them to act as Push and Pop operations of Stack.




Write a method in python to find and display the prime numbers between 2 to N. Pass N as argument to the method.




Evaluate the following postfix notation of expression. Show status of stack after every operation.
84,62,-,14,3, *,+




Differentiate between the following:
(i) f = open (‘diary. txt’, ‘r’)
(ii) f = open (‘diary. txt’, ‘w’)




Write a method in python to read the content from a text file diary.txt line by line and display the same on screen.




Consider the following definition of class Member, write a method in python to write the content in a pickled file member.dat

class Member:
    def_init_(self,Mno,N) :
    self.Memno=Mno
    self.Name=N
def Show(self):
    Display (self.Memno, "#" , self.Name)


Section-C


Observe the following table carefully and write the names of the most appropriate columns, which can be considered as
(i) candidate keys and (ii) primary key.

Id Product Qty Price Transaction Date
101 Plastic Folder 12” 100 3400 2014-12-14
104 Pen Stand Standard 200 4500 2015-01-31
105 Stapler Medium 250 1200 2015-02-28
109 Punching Machine Big 200 1400 2015-03-12
103 Stapler Mini 100 1500 2015-02-02



Consider the following DEPT and WORKER tables. Write SQL queries for (i) to (iv) and find outputs for SQL queries (v) to (viii) :
Table: DEPT

DCODE DEPARTYMENT CITY
D01 MEDIA DELHI
D02 MARKETING DELHI
D03 INFRASTRUCTURE MUMBAI
D05 FINANCE KOLKATA
D04 HUMAN RESOURCE MUMBAI

Table: WORKER

WNO NAME DOJ DOB GENDER DCODE
1001 George K 2013-09-02 1991-09-01 MALE D01
1002 Ryma Sen 2012-12-11 1990-12-15 FEMALE D02
1003 Mohitesh 2013-02-03 1987-09-04 MALE D05
1007 Anil Jha 2014-01-17 1984-10-19 MALE D04
1004 Manila Sahai 2012-12-09 1986-11-14 FEMALE D01
1005 R SAHAY 2013-11-18 1987-03-31 MALE D02
1006 Jaya Priya 2014-06-09 1985-06-23 FEMALE D05

Note: DOJ refers to date of joining and DOB refers to date of Birth of workers.

(i) To display Wno, Name, Gender from the table WORKER in descending order of Wno.

(ii) To display the Name of all the FEMALE workers from the table WORKER.

(iii) To display the Wno and Name of those workers from the table WORKER w ho are born between ‘1987-01-01’ and ‘1991-12-01’.

(iv) To count and display MALE workers who have joined after ‘1986-01-01’.

(v) SELECT COUNT(*),DCODE FROM WORKER GROUP BY DCODE HAVING COUNT(*)>1;

(vi) SELECT DISTINCT DEPARTMENT FROM DEPT;

(vii) SELECT NAME,DEPARTMENT,CITY
FROM WORKER W,DEPT D
WHERE W.DCODE=D.DCODE AND WNO<1003;

(viii) SELECT MAX(DOJ),MIN(DOB)FROM WORKER;




Verify the following using Boolean Laws.
X + Y’= X.Y+X.Y’+X’.Y’




Draw the Logic Circuit for the following Boolean Expression :
(U + V’).W’ + Z




Derive a Canonical SOP expression for a Boolean function F, represented by the following truth table:

A B C F(A,B,C)
0 0 0 1
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 0
1 1 0 0
1 1 1 1



Reduce the following Boolean Expression to its simplest form using K-Map :
F(X,Y,Z,W) = ∑(0,1,6,8,9,l0,11,12,15)




Illustrate the layout for connecting 5 computers in a Bus and a Star topology of Networks.





Differentiate between ftp and http.




Out of the following, which is the fastest (i) wired and (ii) wireless medium of communication?
Infrared, Co‐axial Cable, Ethernet Cable, Microwave, Optical Fiber





Out of the following, which all comes under cyber crime?
(i) Stealing away a brand new computer from a showroom.
(ii) Getting in someone’s social networking account without his consent and posting pictures on his behalf to harass him.
(iii) Secretly copying files from server of a call center and selling it to the other organization.
(iv) Viewing sites on a internet browser.




Perfect Edu Services Ltd. is an educational organization.It is planning to setup its India campus at Chennai with its head office at Delhi. The Chennai campus has 4 main buildings ] ADMIN, ENGINEERING, BUSINESS and MEDIA.
You as a network expert have to suggest the best network related solutions for their problems raised in (i) to (iv), keeping in mind the distances between the buildings and other given
parameters.

Shortest Distances between various building:

ADMIN to ENGINEERING 55m
ADMIN to BUSINESS 90m
ADMIN to MEDIA 50m
ENGINEERING to BUSINESS 55m
ENGINEERING to MEDIA 50m
BUSINESS to MEDIA 45m
DELHI Head Office to CHENNAI Campus 2175m

Number of Computers installed at various building are as follows:

ADMIN 110
ENGINEERING 75
BUSINESS 40
MEDIA 12
DELHI Head Office 20

(i) Suggest the most appropriate location of the server inside the CHENNAI campus (out of the 4 buildings), to get the best connectivity for maximum no. of computers. Justify your answer.

(ii) Suggest and draw the cable layout to efficiently connect various buildings within the CHENNAI campus for connecting the computers.

(iii) Which hardware device will you suggest to be procured by the company to be installed to protect and control the internet uses within the campus?

(iv) Which of the following will you suggest to establish the online face]to]face communication between the people in the Admin Office of CHENNAI campus and DELHI Head Office?
(a) Cable TV
(b) Email
(c) Video Conferencing
(d) Text Chat



Total Marks.70