SAMPLE PAPER-II - Class XII (Computer Science) QP With MS BP
SAMPLE PAPER-II - Class XII (Computer Science) QP With MS BP
v. Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.pop(1)?
(a) [3, 4, 5, 20, 5, 25, 1, 3]
(b) [1,3,3, 4, 5, 20, 5, 25]
(c) [3, 5, 20, 5, 25, 1, 3]
(d) [1, 3, 4, 5, 20, 5, 25,]
vi. What is the output of the following program : print "Hello World"[::-1]
(a) dlroW olleH (b) Hello Worl (c) d (d) Error
print myfunc(2)
(a) 8 (b) 16 (c) Indentation Error (d) Runtime Error
ix. What is the output of the following program?
numberGames = {}
numberGames[(1,2,4)] = 8
numberGames[(4,2,1)] = 10
numberGames[(1,2)] = 12
sum = 0
for k in numberGames:
sum += numberGames[k]
xiii. What will be the output of the code snippet if input is ‘1bzz’
Inp = raw_input('Enter a string') 2
while len(Inp)<=4:
if Inp[-1]=='z':
Inp=Inp[0:3]+'c'
elif 'a' in Inp:
Inp = Inp[0]+ 'bb'
elif not int(Inp[0]):
Inp='1'+Inp[1:]+ 'z'
else:
Inp=Inp+ '*'
print(Inp)
Q2 (a) Write the definition of a function reverse(X) in Python to display the elements in reverse 2
order such that each displayed element is twice of the original element of the list X.
For example:
if the input List X is [4,8,7,5,6,11,10] then the function produces output as –
20, 22, 12, 10, 14, 16, 8
(b) Write a user defined function GenNum(a, b) to generate odd numbers between a and b 2
(including b)
(d) Write functions to perform insert (Enqueue) and delete (Dequeue) operations in a Queue 4
containing Member details as given in the following definition of item node: -
Node
Member No Integer, Member Name String, Age Integer
def isEmpty(Qu)
if Qu==[]:
return True
else:
return False
def Enqueue(Qu, item)
# write code to insert an item in the Queue
def Dequeue(Qu)
# write code to delete an item from the Queue
(b) Write a user defined function in Python that displays number of lines starting with ‘H’ present 3
in the text file Poem.txt.
Q4 (a) What do the underlined areas represent in the MAC address - 1
10:B5:03:63:2E:FC
(b) What is the difference in working of switches and routers? 2
(c) Define the term Cloud in context of Internet. Give some examples. 2
(d) What is a URL? Identify the various parts of a URL in the example given below: 2
http://encycle.msn.com/getinfo.styles.asp
(e) Look at the image given below and answer questions that follow : -
2
(f)
(1) What is the above image representing?
(2) Which device in the Internet terminology does modulation demodulation?
(g) Expand the terms: TCP, VoIP, SSL, NFC, IMAP, FTP, WiFi, HTTPS 2
(h) What measures wireless networks employ to avoid collisions? 2
Q5 (a) Write a MYSQL-Python connectivity code to retrieve one record at a time from table 3
EMPLOYEES who live in ‘Delhi’
(b) Consider the tables given below: - 6
STAFF
StaffID Name Department Gender Experience
1125 Nihara Sales F 12
1263 Kartik Finance M 6
1452 Payal Research F 3
236 Aryan Sales M 8
366 Laxman Finance M 10
321 Krishna Sales M 7
SALARY
StaffID Basic Allowance Comm
1452 12000 1000 200
321 23000 2300 900
1125 32000 4000 100
236 12000 52000 800
336 42000 1700 700
1263 18900 1690 150
With reference to the above table, write commands in SQL for (i) to (iv) and output for (v) to
(viii)
(i) To display names of all staff that are in Sales department having experience less than 9
years and commission more than 700
(ii) Display average salary of staff working in Finance department. Salary= Basic+Allowance
(iii) Display number of female members in each department.
(iv) Display name of employee earning maximum salary.
Give Output
(v) SELECT NAME FROM STAFF ST, SALARY SA WHERE COMM <=700 AND ST.STAFFID =
SA.STAFFID
(vi) SELECT NAME, BASIC FROM STAFF, SALARY WHERE DEPT=”SALES” AND STAFF.STAFFID=
SALARY.STAFFID
(vii) SELECT COUNT(DEPARTMENT),DEPARTMENT FROM STAFF GROUP BY DEPARTMENT
(viii) SELECT COUNT(*),GENDER FROM STAFF GROPU BY GENDER
(c) What are two types of HTTP requests? Write a view function that an process a GET request 2
and display “main.html” as template. Assume that required files and methods are already
imported.
(d) You have created a Django project folder. It contains 3 apps as: Register, Sell and Work. 2
What will be the contents of Django project folder? List the folders (not files inside the
folders)
(e) What is a Django template? 2
Q6 (a) “Privacy stands for protection of personal information given online. Especially in e-commerce, 2
it is related to a company’s policies on the use of user’s data”.
(i) Why is the above given statement important?
(iii) What is the need to safeguard user privacy?
(b) Expand the terms: FLOSS, SDLC, OSS, GNU 2
(c) Sumit downloaded XYZ software from the internet. After 2 weeks the software is asking Sumit 2
to purchase a license for it to work at its best. In this context answer the questions –
(i) XYZ comes under what category of software.
(ii) Can Sumit see the source code and also freely edit the software code of XYZ software?
(d) ABC has by online medium duped a person of 50 thousand rupees? What kind of crime is this 2
and how will it be resolved?
(e) A producer has made a movie whose story line is completely based on a previous Hollywood 2
movie. This producer did not take permission to make the movie based on this story. The
writer of the story has now filed a case against this producer in court?
(a) Which kind of offence is this?
(b) What are the consequences?
Solutions
Q1 Ans A
Ans D
Ans C
Ans A
Ans C
Ans A
Ans C
Ans C
Ans B
Ans B
Ans C
Ans B
Ans - 1bzc*
(d) The folders are: EasySell – Base directory of Project. This folder contains in it EasySell – Project
Web application folder, in addition to Register, Sell and Work folders.
(e) Django templates make up the presentation tier of Django. A template can use any presentation
format such as XML,HTML etc. Templates can also include logic to fill in data or values coming
from Django’s files and databases.
Q6 (a) (i) It is important for the safeguard of user privacy online.
(ii) Online world is an open world and so the personal information of a user must not be available
openly as it may be misused. Hence the privacy is important.
(b) FLOSS: Free Libre and Open Source Software
SDLC – System Development Life Cycle
OSS – Open Source Software
GNU – GNU is not UNIX
(c) (i) XYZ is a shareware.
(ii) No, it is not possible for Sumit to see the source code and edit the software.
(d) ABC has committed Identity Theft (a part of Cyber Crime). The affected person needs to report this
theft to the cyber cell of the police department.
(e) (i) This is a case of Plagiarism (Stealing)
(ii) The producer may have to face huge fine and penalties in this case.