SlideShare a Scribd company logo
1 | P a g e
COMPUTER SCIENCE – NEW (083) SAMPLE
QUESTION PAPER I (2019-20) CLASS- XII
Max. Marks: 70 Time: 3 hrs
General Instructions:
● All questions are compulsory.
● Question paper is divided into 4 sections A, B, C and D.
▪ Section A : Unit-1
▪ Section B : Unit-2
▪ Section C: Unit-3
▪ Section D: Unit-4
SECTION A
Q1 A) Which of the following is valid arithmetic operator in Python:
(i) % (ii) ! (iii) > (iv) or
1
B) Identify the valid identifier name from the following
(i) 9if (ii) roll_no
1
C) Name the Python Library modules which need to be imported to invoke the
following functions:
(i) cos() (ii) dump ()
1
D) Rewrite the following code in python after removing all syntax error(s).
Underline each correction done in the code.
5=k
for m in range(0,k)
if m%4=0:
print(m*4)
else:
print “m+3”
2
E) Find the output of the following
def textchanger(text):
L = len(text)
ntext=””
for i in range(0,L) :
if text [i].isupper() :
ntext = ntext + text[i].lower()
elif text [i].isalpha() :
ntext = ntext + text[i].upper()
else:
ntext = ntext + ‘bb’
print(ntext)
textchanger(gmail@com)
2
F) Study the following program and select the possible output(s) from the options (i)
to (iv) following it. Also, write the maximum and the minimum values that can be
assigned to the variable Y.
import random
X= random.random()
Y= random.randint(0,4)
print(int(X),":",Y+int(X))
(i)0 : 0
(ii) 1 : 6
2
2 | P a g e
(iii)2 : 4
(iv) 0 : 3
G) Find and write the output of the following python code:
def Change(X ,Y=10):
X=X+Y
X=x-Y
print( X,"#",Y)
return (X)
X=5
Y=20
X=Change(X,Y)
print(X,"#",Y)
Y=Change(Y)
print(X,"#",Y)
3
Q2 A) Define comment in python 1
B) Identify the correct option for declaration of a tuple with single element
i)(‘kv’,)
ii)(5,)
iii(5)
iv)i ) and ii) are correct way to declare tuple
1
C) Declare a dictionary of toppers of your class with their name as keys and marks
obtained as there value
1
D) Find the output of the following
X=”Iamaprogrammer”
print(X[2:])
print(X[3:8]
1
E) What will the following function return?
def add(a,b,c):
print(a+b+c)
1
F) What do you understand by actual and formal argument Differentiate between
them with a python example.
Or
Write a recursive function rec_sum(n) where n is any natural number and function
returns sum of n natural number
G) Write a function in python to count the number of lines in a text file ‘SAMPLE.TXT’
which is starting with an alphabet ‘H’ .
OR
Write a method/function DISPLAY() in python to count number of lines from a text
file SAMPLE.TEXT.
2
H) What will be the output of the following code :
Import matplotlib. pyplot as plt
#Plotting to our canvas
plt.plot([1,2,3],[4,5,1])
#Showing what we plotted
plt.show()
OR
Write a program to create a horizontal bar graph of following data. Add
suitable labels.
City Population
Delhi 23456123
Mumbai 20083104
2
3 | P a g e
Bangalore 18456123
Hyderabad 13411093
I) Compare the algorithm efficiency of linear and binary search algorithm 2
J) Write a function in Python, INS_QU(A,da) and DEL_QU(A) for performing
insertion and deletion operations in a Queue. A is the list used for implementing
queue and d is the value to be inserted.
OR
Write a function in python, Push(employee) and Pop(employee) to add and delete
An employee where employee is a tuple which contains name of employee and
empno considering them to act as push and pop operation of the stack data
structure
4
SECTION B
Q3 A) ----------- is a set of rules used for communication 1
B) -------------protocol is used for sending email 1
C) Define modulation and write name of two modulation techniques 1
D) Define IOT 1
E) Explain the working of Email 2
F) Differentiate between IPv4 and IPv6 2
G) Expand the following terms
i)NFC ii)IMAP iii)CDMA
iv)MAC v)VoIP vi)URL
3
H) Standard Bank has set up its new center in India for its office and web based
activities. It has five buildings as shown in the diagram below:
(a) Suggest a possible cable layout for connecting the buildings.
(b) Suggest the most suitable place to install the server of this
organization.
Distance between various buildings
A to B 50 Mts
B to C 30 Mts
C to D 30 Mts
D to E 35 Mts
E to C 40 Mts
D to A 120 Mts
D to B 45 Mts
E to B 65 Mts
No of computers
A 55
B 180
C 60
D 55
E 70
4
A
E
D
B C
4 | P a g e
(c) Suggest the placement of the following devices with justification.
(i.) Hub/Switch
(ii.) Repeater
(d) The company wants to link its head office in ‘A’ building to its Office
in Sydney
(i) Which type of transmission medium is appropriate for such a
link?
(ii) What type of network this connection result into?
SECTION C
Q4 A) Which command is used to create a django project
i)django-admin startproject <projectname>
ii)django_admin startproject <projectname>
iii)django-admin start project <projectname>
iv)All of these
1
B) Which of the following is not a DDL command
i)Create
ii)Alter
iii)Delete
iv)All are DDL Command
1
C) What is menat by NULL values in MYSQL 1
D) Differentiate between Char and Varchar DataTYpe 1
C) Differentiate between Primary Key and Foregin key
Or
Differentiate between Alter and Update Command
2
D) Explain teo types of HTTP request 2
E) Consider the following tables HOSPITAL. Give outputs for SQL queries
(i) to (iii)
No Name Age Department Dateofadmin Charge Sex
1 Arpit 62 Surgery 21/01/06 300 M
2 Zayana 18 ENT 12/12/05 250 F
3 Kareem 68 Orthopedic 19/02/06 450 M
4 Abhilash 26 Surgery 24/11/06 300 M
5 Dhanya 24 ENT 20/10/06 350 F
6 Siju 23 Cardiology 10/10/06 800 M
7 Ankita 16 ENT 13/04/06 100 F
8 Divya 20 Cardiology 10/11/06 500 F
9 Nidhin 25 Orthopedic 12/05/06 700 M
10 Hari 28 Surgery 19/03/06 450 M
i) Select SUM(Charge) from HOSPITAL where Sex=’F’;
(ii) Select COUNT(DISTINCT Department ) from HOSPITAL;
(iii) Select SUM(Charge) from HOSPITAL group by Department;
3
F) Consider the tables ITEMS & COMPANY. Write SQL commands for the
statements (i) to (iv) and give the outputs for SQL queries (v) to (viii).
Table : ITEMS
ID PNAME PRICE MDATE QTY
4
5 | P a g e
T001 Soap 12.00 11/03/2007 200
T002 Paste 39.50 23/12/2006 55
T003 Deodorant 125.00 12/06/2007 46
T004 Hair Oil 28.75 25/09/2007 325
T005 Cold Cream 66.00 09/10/2007 144
T006 Tooth Brush 25.00 17/02/2006 455
Table : COMPANY
ID COMP City
T001 HLL Mumbai
T008 Colgate Delhi
T003 HLL Mumbai
T004 Paras Haryana
T009 Ponds Noida
T006 Wipro Ahmedabad
i)To display PNAME, PRICE * QTY only for the where price is greater than
100
ii)To display company name & city for ID= T001 and T008
iii)To delete the items produced before 2007.
iv)To increase the quantity by 20 for soap and paste.
SECTION D
Q5 A) What are the different ways in which authentincation of a person can be
performed?
2
B) Define the term open data 1
C) Write any two categories of cyber crime 2
D) Explain Phishing. 2
E) How can we recycle e-waste safely? 2
F) if someone attacks your web site, who would you complain to ? 1
COMPUTER SCIENCE – NEW (083) SAMPLE QUESTION PAPER
(2019-20) CLASS- XII
6 | P a g e
MARKING SCHEME
SECTION A
Q1 A) (i) % 1
B) (ii) roll_no 1
C) (i) cos() :-Math (ii) dump ():-pickle 1
D) Rewrite the following code in python after removing all syntax error(s).
Underline each correction done in the code.
k=5
for m in range(0,k):
if m%4==0:
print(m*4)
else:
print (m+3)
2
E) GMAILbbCOM 2
F) Mimimum value of Y=0
Maximum value of Y=4
(i)0 : 0
( (iv) 0 : 3
2
G) 5 # 20
5 # 20
20 # 10
5 # 20
3
Q2 A) Comments are the code lines which are not executed by python interprerer
It is used to make program more readable and easy to understand
1
B) iv)i ) and ii) are correct way to declare tuple 1
C) Top={‘A’:97,”B:98,’C’:99} 1
D) Find the output of the following
X=”Iamaprogrammer”
print(X[2:]) :maprogrammer
print(X[3:8]maprog
1
E) None 1
F) Actual argument is the argument defined at the time of function calling
.formal argument is used at the time of function definition.Actual argument
can be a variable,or expression or literal
Or
def rec_sum(n):
if n =1:
return(1)
else:
return((a+rec_sum(n-1))
2
G) def count():
f1=open(‘sample.txt’,’r’)
c=0
. l1=f1.readlines()
for k in l1:
2
7 | P a g e
If k[0]==’H’
C=C+1
OR
def count():
c=0
f1=open(‘sample.txt’,’r’)
. l1=f1.readlines()
For k in l1:
C=C+1
H)
OR
½ marks for import matplotlib.puplot
½ marks for creation of list
½ marks for barhfunction
½ marks for use of xticks
2
I) 1 marks for linear search and 1 foe binary search 2
J) def IN_QU(A):
data=int(input("enter data to be inserted: "))
A.append(data)
def DEL_QU(A):
if (Arr==[]):
print( "Queue empty")
else:
print ("Deleted element is: ",A[0])
del(A[0])
( ½ mark insert header)
( ½ mark for accepting a value from user)
( ½ mark for adding value in list)
( ½ mark for delete header)
( ½ mark for checking empty list condition)
( ½ mark for displaying “Queue empty”)
( ½ mark for displaying the value to be deleted)
( ½ mark for deleting value from list)
OR
def Push(employee):
a=int(input("enter package title : "))
employee.append(a)
def Pop(employee):
if (employee==[]):
4
8 | P a g e
print( "Stack empty")
else:
print ("Deleted element:",employee.pop())
(½ mark for Push() header)
( ½ mark for accepting a value from user)
( ½ mark for adding value in list)
( ½ mark for Pop() header)
( ½ mark for checking empty list condition)
( ½ mark for displaying “Stack empty”)
( ½ mark for displaying the value to be deleted)( ½ mark for deleting the
value)
SECTION B
Q3 A) PROTOCOL 1
B) SMTP 1
C) Modulation is the process of modulating message signal .Two Types of
modulation are :Amplitude modulation and Frequency Modulation
1
D) It is the network of physical objects or things embedded with
electronics,software,sensors and network connectivity which enables these
objects to collect and exchange data
1
E) Email System comprises of following components
• Mailer
• Mail Server
• Mailbox
Mailer:It is also called mail program,mail application or mail client .It allows
us to manage ,read and compose email
Mail Server:The function of mail Server is to receive ,store and deliever the
email.It is a must for mail server to be running all the time because if it
crashes or is down,email can be lost
Mailboxes :Mailboxes is generally a folder that contains emails and
information about them.
2
F) IPV4 Internet is protocol version 4 and IP6 is Internet protocol version 6
IPv4 is 32 bit and IPv6 is 128 bit
IPv6 is still in transition phase and it will expected to replace IPV4
2
G) Expand the following terms
i)NFC (Near Field Communication)
ii)IMAP (Internet Message Access Protocol)
iii)CDMA(code division multiple access)
iv)MAC(Media Access Control)
v)VoIP (Voice Over Internet Protocol)
vi)URL(Uniform resourse locator)
1/2×6=3
H) a) 1+1+1+1
A B C
9 | P a g e
b)Building B
c) i)Hub/Switch is placed in each building
ii)Repeater is placed between D TO A
d)i)Satellite Communication
ii)WAN
SECTION C
Q4 A) I)django-admin startproject <projectname> 1
B) iii)Delete 1
C) NULL value means empty value 1
D) Char is fixed length width but varchar is variable length width 1
C) i)Primary key is the key which uniquely identifies a tuple but foreign key is
the key which takes reference from primary key
ii)There is only one primary key in a table but there can be multiple foreign
key on a table
iii)Primary key is not NULL but Null can be allowed in foreign key
iv)primary key must be unique but duplicate values are not allowed in
primary key
Or
Alter command in DDL command but update command is DML Command
Alter command is used to add,modify and delete a column from the table
and update command is used to make changes in the record of the table
1+1
D) 1)HTTP Get Request
2)HTTP Post Request
1 marks for each type of correct explanation
1+1
E) i)1200
ii)4
iii)1050
700
1150
1300
1+1+1
F) i)Select PNAME, PRICE * QTY from ITEMS where Price>100
ii)Select comp,city from company where ID IN(‘T001’ AND ‘T008’
iii)DELETE * from ITEMS where year(MDATE)<2007.
iv)Update ITEMS Set QTY=QTY+20 where Items in (‘soap’,’paste)
1+1+1+1
SECTION D
Q5 A) Passwods, Token, Biometrics, OTP 2
B) Open Data: Data that can be freely available and republished 1
10 | P a g e
C) Cyber crime encompasses a wide range of activities, but these can generally
be broken into two categories:
•Crimes that target computer networks or devices: Such types of crimes
include viruses and
denial-of-service (DoS) attacks.
•Crimes that use computer networks to advance other criminal activities:
These types of crimes
include cyberstalking, phishing and fraud or identity theft.
2
D) Fraudulent attempt to obtain sensitive information such as User
name,Password and Credit card detail as trust worthy entity through
electronic communication
2
E) (i) Use a certified e-waste recycler.
(ii) Visit civic institutions. Check with your local government, schools and
universities for additional responsible recycling options.
(iii) Explore retail options.
(iv) Donate your electronics
2
F) Complaint has to be lodged under IT Act. 1
SAMPLE PAPER II 2019-20
11 | P a g e
COMPUTER SCIENCE(083) – XII
Time allowed : 3 hours Maximum Marks : 70
SECTION A
1 a Differentiate between List and Tuple. 1
b What would be the Output?
STRING="WELCOME NOTE”
for S in range(0,7):
print (STRING[S])
print (S,STRING)
1
c Find error in the following code and correct code by rewriting it and underlining the
corrections.
X=int(“Enter value for x:”))
for in range[0,11]:
if x=y
print (x+y)
else :
Print (x-y)
2
d Which of the following are valid keywords in Python:
(i) Elif (ii) for (iii) While (iv) if
1
e Convert the following for loop into while loop:
for k in range(10,20,5):
print (k)
1
f Name the Python Library modules which need to be imported to invoke the following
functions : (i) sqrt() (ii) randint()
1
g Rewrite the following code in python after removing all syntax error(s). Underline each
correction done in the code.
if n==0
print(“zero”)
elif n==1:
print(“one”)
elif n==2:
print(“two”)
else n==3:
2
12 | P a g e
print(“three”)
h Write the output of the following python code:
def ChangeList():
L=[]
L1=[]
L2=[]
for i in range(1,10):
L.append(i)
for i in range(10,1,2):
L1.append(i)
for i in range(len(L1)):
L2.append(L1[i]+L[i])
L2.append(len(L)-len(L1))
print(L2) ChangeList()
3
2 a Write a function to find factorial of a number using recursion. 2
b What possible output(s) are expected to be displayed on screen at the time of
execution of the program from the following code ? Also specify the maximum values
that can be assigned to each of the variables BEGIN and LAST.
import random
POINTS=[20,40,10,30,15];
POINTS=[30,50,20,40,45];
BEGIN=random.randint(1,3)
LAST=random.randint(2,4)
for C in range(BEGIN,LAST+1):
print( POINTS[C],"#")
(i) 20#50#30# (ii) 20#40#45# (iii) 50#20#40#45# (iv) 30#50#20#
2
c Find and write the output of the following Python code:
Data = ["P",20,"R",10,"S",30]
Times = 0
Alpha = ""
Add = 0
for C in range(1,6,2):
Times = Times + C
Alpha = Alpha + Data[C-1]+"$"
2
13 | P a g e
Add = Add + Data[C]
print( Times,Add,Alpha)
d Suppose L=[“abc”,[6,7,8],3,”mouse”] then L[ : :2] is
i) [ “abc”,[6,7,8] ] ii) [ “abc “ , 3] iii) [3, ] iv) [“abc”,[6,7,8],3,”mouse”]
1
e Write a method add, delete and display records using list implementation through stack 3
f Differentiate Local variable with Global variable. 1
g Write a Python Program to plot line chart for values x=[1,2,3,4,5]y=[65,45,76,26,80] 2
h Write a function in python to count number of lines starting with letter ‘K’ from text
file ‘record.txt’
2
i Define a function display ( ) in python to print those records from binary file ‘db.dat’
of employees whose salary is >20000. [Each Record has fields Name & Salary
separated by [ : ] ]
3
SECTION B
3 a Expand the following
(i)PPP (ii) TDMA
(iii)TCP/IP (iv) VOIP
2
b What is MAC address ? Give example. 2
c What is Cloud Computing? Write two advantages of Cloud Services. 2
d Name the network tools used in the given situation
(i) to troubleshoot internet connection problem
(ii) to see the IP address associated with a domain name
(iii) to look up registration record associated with a domain name
(iv) to test the speed of internet connection
2
e Define the terms i) Cladding ii) attenuation iii) Telnet 3
g ABC company is planning to set up their new offices in India with its hub at Hyderabad . As a
Network advisor ,understand their requirements and suggest to them best solution.
4
14 | P a g e
Block to Block distance (in Meters):
Block From Block Distance
Human Resource Conference 60
Human Resource Finance 60
Conference Finance
Expected Number of Computer installed in each building block:
Block Computer
Human Resource 125
Finace 25
Confrence 60
i) What is the most suitable block to install server?
ii) What will be the best possible connectivity out of the following to connect its new
office in Bengaluru
With its London-based office ?
i)Infrared ii)Satellite iii) Ethernet Cable
iii) Which of the following devices will you suggest to connect each computer in each of
the above blocks?
i) Gateway ii) Switch iii) Modem
iv) Write the name of any two popular Open Source Software which are used as Operating
Systems.
SECTION C
4 a What is the command to install Django? 1
b What is the difference between between GET and POST method? 2
c What is NULL Value ? 1
d Write python-mysql connectivity to retrieve all the data of table student 2
e Differentiate between Degree and Cardinality. 2
15 | P a g e
f In a Bank’s database, there are two tables ‘Customer’ and ‘Transaction’ as shown below.
Table : Customer
Acc_No Cust_Name Cust_City Cust_Phone Open_Bal
2101001 Sunita Ambala 9710557614 10000
2201002 Sandhya Patna 8223545233 15000
2301003 Vivek New Delhi 9972136576 13000
2401004 Meena New Delhi 9321305453 10000
Table :Transaction
Trans_Id Acc_No Transaction_Type Amount
Tr001 2301003 Credit 15000
Tr002 2201002 Credit 20000
Tr003 2101001 Debit 3500
Tr004 2301003 Credit 26000
Tr005 2301003 Credit 24000
6
1 Write a query to display customer’s name who has withdrawn the money.
2 Write a query to display customer’s name along with their transaction details.
3 Write a query to display customer’s name who have not done any transaction yet.
4 How many rows and column will be there in the Cartesian product of the above given tables.
Also mention the degree and cardinality of the Cartesian product of the above given tables.
5 Select Acc_No, sum(Amount) from Customer c, Transaction t where
c.Acc_No=t.Acc_No group by c.Acc_No having Transaction_Type="Credit";
6 Discuss the significance of having clause with group by statement with suitable example.
SECTION D
5 a What are Intellectual Property Rights (IPR)? 1
16 | P a g e
b Differentiate between open source software and free software 2
c What is online fraud? 2
d What do you understand by plagiarism? 2
e How does phishing happen? 2
f if someone attacks your web site, who would you complain to ? 1
17 | P a g e
MARKING SCHEME
SAMPLE PAPER II 2019-20
SECTION A
1 a List in python represents a group of comma separated values of any datatype between
square brackets. eg [“neha”,42,12.56]
Tuples are represents a group of comma separated values of any datatype within
parentheses. eg ( 1,2,3,4,5)
1
b W
E
L
C
O
M
E
6 WELCOMENOTE
1 mark for correct output
1
c x=int(input(“Enter value for x:”))
for y in range(0,11):
if x==y :
print ( x+y)
else :
print ( x-y )
2 Marks for removal of all errors (1/2 Marks for each corrected line)
2
d valid keywords in Python:
(i) for (iv) if
1/2 Marks for each corrected
1
e 1 mark for complete correct while conversion (1/2 for partial corrected loop) 1
f (i) math (ii) random
1/2 mark for each option
1
g n=0
if n==0:
2
18 | P a g e
print(“zero”)
elif n==1:
print(“one”)
elif n==2:
print(“two”)
else :
print(“three”)
2 Marks for removal of all errors (1/2 Marks for each corrected line)
h [11, 10, 9, 8, 7, 4]
(3 marks for correct output. Partial marking can also be given)
3
2 a 1 mark for correct logic
½ mark for correct if statement and ½ mark for writing recursive call
2
b (ii) 20#40#45#
(iii) 50#20#40#45#
Minimum value for BEGIN:1 Minimum value for LAST:2
(1 Mark for writing the correct options)
(½ Mark for writing each correct Minimum value of BEGIN AND LAST)
2
c 1 20 P$
4 30 P$R$
9 60 P$R$S$
(2 marks for correct output. )
2
d ['abc', 3]
(1 mark for correct answer)
1
e s=[]
c=’y’
while( c==’y’):
print(“ 1 for Push”)
print(“ 2 for Pop”)
print(“ 3 for display”)
choice=int(input(“Enter your choice”))
if(choice==1):
a=int(input(“Enter a number”))
s.append(a)
3
19 | P a g e
elif (choice==2):
if s==[ ] :
print(“Stack is empty”)
else:
print(“Deleted element is :” s.pop())
elif (choice==3):
l=len(s)
for i in range(l-1,-1,-1):
print(s[i])
else:
print (“Wrong input”)
c=input(“do you want to continue y or n ”)
f 1/2 mark for each correct definition 1
g import matplotlib.pyplot as plt
import numpy as np x=[1,2,3,4,5] y=[65,45,76,26,80]
plt.plot(x,y) plt.xlabel("X axis")
plt.ylabel("Y axis ")
plt.title("Graph for x=[1,2,3,4,5] y=[65,45,76,26,80]")
plt.show()
2 mark for correct answer
2
h f=open(“record.txt”,”r”) (1+1=2)
lines=0
l=f.readlines()
for i in I:
if i[0]==’K’
lines=lines+1
print(“No of Lines:”,lines)
2 mark for correct answer
2
i def display():
i=open(“db.dat” , rb+”)
x=i.readlines()
while (x):
I=x.split(‘:’)
if I[2]>20000:
print(x)
x=i.readlines()
i.close()
3 mark for correct answer, partial marks can be given.
3
20 | P a g e
SECTION B
3 a PPP: Point to Point Protocol
TDMA:Time division multiple Access
TCP/IP: Transmission Control Protocol/Internet Protocol
2
VOIP:Voice Over Internet Protocol
½ marks for each correct expansion
b Medium access control Physical Address of NIC Card assigned by manufacturer stored on
ROM. (1+1=2)
e.g 00:0d:83:b1:c0:8e
1 mark for correct definition and 1 mark for example
2
c Cloud computing is an internet based new age computer technology. It is the next stage
technology that uses the cloud to provide the services whenever and wherever the user
needs it. It provides a method to access several servers worldwide
Two advantages of Cloud Computing:
i) Data backup and storage ii) Powerful server capability
2 marks for correct explanation.
2
d (i) ping
(ii) nslookup
(iii) whois
(iv) speedtest.net
½ mark for each correct answer
2
e Cladding: Layer of glass surrounded the Centre fibre of glass in fibre optics cable.
Attenuation: Degeneration of signal over a distance on network cable.
Telnet: Service to log in remotely on any computer over network.
½ mark for each correct line (Max 2 marks for correct answer)
3
g i)Human Resource Block
ii) Ethernet Cable
iii) Switch
iv) Linux and Open Solaris
1 mark for each correct answer
4
SECTION C
4 a pip install django
( 1 mark for correct answer)
1
b 1 mark for each correct answer 2
21 | P a g e
c NULL value is value in table with blank field 1
d import mysql.connector
mydb=mysql.connector.connect(user="root",host="localhost",passw
d="123",database="inservice") mycursor=mydb.cursor()
mycursor.execute("select * from student") for x in mycursor:
print(x)
2 marks for correct statements
2
e 2 marks for correct difference 2
f
1
Select cust_name from customer c,transaction t where c.Acc_No=t.Acc_No and
Transaction_Type= "Debit";
1
2 Select cust_name, t.* from customer c, transaction t where c.Acc_No = t.Acc_No; 1
3 Select cust_name from customer c,transaction t where
c.Acc_No!=t.Acc_No;
1
4 Cartesian Product
Number of Rows: 20
Number of Columns: 9
Degree: 9
Cardinality: 20
1
5 2301003 65000
2201002 20000
1
6 select Acc_No, sum(Amount) from Customer c, Transaction t where c.Acc_No=t.Acc_No group
by c.Acc_No having Transaction_Type="Credit";
1
SECTION D
5 a IPR is a general term covering patents, copyright, trademark, industrial designs, geographical
indications, layout design of integrated circuits, undisclosed information (trade secrets) and
new plant varieties.
1 mark for correct definition
1
b 1 mark for each correct definition 2
c Fraud committed using the internet call online fraud. Online fraud my occur in many forms
such as non-delivered goods, non-existent companies, stealing information, fraudulent
payments etc.
2
d 2 marks for correct answer 2
22 | P a g e
e Phishing is typically carried out by email spoofing or instant messaging and it often directs
users to enter personal information at a fake website, the look and feel of which is identical
to the legitimate one and the only difference is the URL of the website in question
2
f Complaint has to be lodged under IT Act 1
23 | P a g e
SAMPLE PAPER III
SUBJECT COMPUTER SCIENCE (XII-083)
Time 3hrs M.M. 70
1 a) Which of the following is valid operator in python :
I ) % 2) **= 3) < 4) not
1
b) Write the type of tokens from the following :
1) for 2)_fn
1
c) Nam the python library modules which need to be imported to invoke the
following functions:
1) sin() 2) randint()
1
d) Rewrite the following code in python after removing all syntax error(s).underline
each correction done in code.
O,P= 10=20
for j n range[O,P]:
print(p*4)
T= p+5
Print(T)
2
e) Find and write the output:
def solve(s1):
k=len(s1)
s2=''
for j in range (0,k):
if s1[j].isupper():
s2=s2+s1[j+1].lower()
elif s1[j].islower():
s2=s2+s1[j-1].upper()
else:
s2=s2+'@'
print(s2)
solve('WeLcoMe')
2
f) Find and write the output of the following python code:
def update(p,q=10):
p=p+q
q=p-q
print(p,”#”,q)
return (p)
p1=40
q1=20
p1=update(p1,q1)
print(r,”@”,q1)
q1=update(q1)
3
g) What possible outputs are expected to be displayed on the screen at the time of
execution of the program from the following code? Also specify the minimum and
maximum values that can be assigned to the variable c.
2
24 | P a g e
import random
temp=[10,20,30,40,50,60]
c=random.randint(0,4)
for I in range(0, c):
print(temp[I],'#',end='')
(i) #10#20 (ii) 10#20#30#40#50# (iii). 10#20#30# (iv) 50#60#
2 a What do you understand by eval()? 1
b Which is the correct form of declaration of dictionary?
i) Day=(1;’mon’, 2;’tue’, 3:’wed’)
ii) Day=[1:’ONE’, 2:’TWO’,3:’THREE’]
iii) Day={1:’APPLE’, 2:’ORANGE’, 3:’GRAPES’}
iv) Day={1’green’, 2’red’,3’blue’]
1
c Identify the valid declaration of L:
L = [1, 23, ‘hi’, 6]
(i) List
(ii) Dictionary
(iii) Array
(iv) Tuple
1
d Find and write the output of the following python code:
x=['5 3 2 1']
y=['8 7 9 10']
z=y+x
print(z)
1
e Find and write the output of the following python code :
def come(n):
n=n+10
m=5+n
n,m=m,n+m
return n,m
P=come(6)
print(P)
1
f What do you understand by UDF? What is the need of it ? 2
g A bar chart is drawn(using pyplot) to represent sales data of various models of
MOBILES, for a month. Write a appropriate statement in python to provide labels
MONTH-JUNE and SALES DONE to x and y axis respectively.
OR.
Give the output from the given python code:
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(1, 5)
plt.plot(x, x*1.5, label='Normal')
plt.plot(x, x*3.0, label='Fast')
2
25 | P a g e
plt.plot(x, x/3.0, label='Slow')
plt.legend()
plt.show()
h Write a function in python to count the number of vowels in a text file data.txt?
OR.
Write a function DISPLAY() in python to read and count the word ‘THIS’ from
“NOVEL.TXT”.
2
i Write a function “perfect()” that determines if parameter number is a perfect
number. Use this function in a program that determines and prints all the perfect
numbers between 1 and 100.
[An integer number is said to be “perfect number” if its factors, including 1(but
not the number itself), sum to the number. E.g., 6 is a perfect number because
6=1+2+3].
OR.
Differentiate between Bubble shot and Insertion soRt. Which one is better?
3
j Write a function in python, AddQ(Arr) and RemoveQ(Arr) for performing insertion
and deletion operations in a Queue. Arr is the list used for implementing queue
and data is the value to be inserted.
OR.
Write a function in python, SPush(package) and SPop(package) to add a new
Package and delete a Package from a List of Package Description, considering them
to act as push and pop operations of the Stack data structure.
4
SECTION-B
Q.3 a ………………….. is an example of cloud. 1
b ………………….. is a network of physical objects embedded with electronics,
software, sensors and network connectivity.
1
c ………………….. is a device to connect two dissimilar network. 1
d ………………….. describes the measuring unit of data transfer rate . 1
e Give the full forms of the following :
(i) SMTP
(ii) SIM
(iii) Lifi
(iv) GPRS
2
f How many pair of wires are there in a twisted pair cable (Ethernet)? What is the
name of the port, which is used to connect Ethernet cable to a computer or a
laptop?
2
g Identify the type of cyber crime for the following situations:
(i) A person complains that Rs. 4.25 lacs have been fraudulently stolen from
his/her account online via some online transactions in two days using NET
BANKING.
(ii) A person complains that his/her debit/credit card is safe with him still
somebody has done shopping /ATM transaction on this card.
(iii) A person complains that somebody has created a fake profile of Facebook
and defaming his/her character with abusive comments and pictures.
3
h Sharma Medicos Center has set up its new center in Dubai. It has four buildings
as shown in the diagram given below:
4
26 | P a g e
Distance between various building are as follows:
As a network expert, provide the best possible answer for the following queries:
i) Suggest a cable layout of connections between the buildings.
ii) Suggest the most suitable place (i.e. buildings) to house the server of this
organization.
iii) Suggest the placement of the following device with justification:
i. a) Repeater b) Hub/Switch
iv) Suggest a system (hardware/software) to prevent unauthorized access to
or from the network.
SECTION-C
Q4. a Which command is used to open the database? 1
b Which clause is used to sort the records of a table? 1
c Which command is used to delete the table? 1
d Which clause is used to remove the duplicating rows of the table? 1
e Differentiate between Django GET and POST method. 2
f Define degree and cardinality. Based upon given table write degree and
cardinality.
2
g
RxID DrugID DrugName Price PharmacyName PharmacyLocation
R1000 5476 Amlodipine 100.00 Rx Pharmacy Pitampura, Delhi
R1001 2345 Paracetamol 15.00 Raj Medicos
Bahadurgarh,
Haryana
R1002 1236 Nebistar 60.00 MyChemist Rajouri Garden, Delhi
R1003 6512 VitaPlus 150.00 MyChemist Gurgaon,Haryana
7
27 | P a g e
Write commands in SQL for (i) to (iv):
I. To increase the price of “Amlodipine” by 50.
II. To display all those medicines whose price is in the range 100 to 150.
III. To display the Maximum price offered by pharmacy located in “Gurgaon”
IV. To display sum of price for each PharmacyName having more than 1 drug.
VI To display Maximum and Minimum price
Write the output(s) produced by executing the following queries:
i) SELECT RxID, Price from PharmaDB where PharmacyNa IN (“Rx Parmacy”,
“Raj Medicos”);
ii) SELECT PharmacyName, COUNT(*) FROM PharmaDB GROUP BY
PHARMACY NAME
R1004 5631 Levocitrezine 110.00 RxPharmacy South Extension,Delhi
SECTION-D
5 a When net is showing the ads related to products you have bought earlier,
phenomenon is known as -----------.
1
b As a citizen of India, what advice you should give to others for e-waste disposal? 1
c What are the two methods to avoid illegal downloading? 2
d Define the term Phishing and Vishing ? 2
e Stealing someone’s intellectual work and representing it as your own known as:-
(i) phishing
(ii) scam
(iii) plagiarism
(iv) intellectual property
2
f What are intellectual property rights? Why should intellectual property rights be
protected?
2
END OF THE THE PAPER
28 | P a g e
MARKING SCHEME
SAMPLE PAPER III- XII CS
Time 3hrs M.M. 70
1 a) Which of the following is valid operator in python :
I ) % 2) AND 3) => 4) **=
1
ANS % , **=
b) Write the type of tokens from the following :
1) for 2)_fn
1
ANS CONTROL FLOW , IDENTIFIER
c) Nam the python library modules which need to be imported to invoke the
following functions:
1) sin() 2) randint()
1
ANS MATH , RANDOM
d) Rewrite the following code in python after removing all syntax error(s).underline
each correction done in code.
O,P= 10=20
for j n range[O,P]:
print(p*4)
T= p+5
Print(T)
2
ANS O,P= 10,20
for j n range(O,P):
print(P*4)
T= P+5
Print(T)
e) Find and write the output:
def solve(s1):
k=len(s1)
s2=” “
for j in range (0,k):
if (s1[i].isupper())
s2=s2+s1[j+1].lower()
elif s1[i].islower()
s2=s2+s1[j-1].upper()
else:
s2=s2+”@”
print(s2)
solve(“WeLcoMe”)
2
ANS eWcLCeM
f) Find and write the output of the following python code:
def update(p,q=10):
p=p+q
q=p-q
print(p,'#',q)
return (p)
3
29 | P a g e
p1=40
q1=20
p1=update(p1,q1)
print(p1,'@',q1)
q1=update(q1)
ANS 60 # 40
60 @ 20
30 # 20
g) What possible outputs are expected to be displayed on the screen at the time of
execution of the program from the following code? Also specify the minimum and
maximum values that can be assigned to the variable c.
import random temp=[10,20,30,40,50,60]
c=random.randint(0,4)
for I in range(0, c):
print(temp[i],’:’,end=’#‘)
(i) #10#20 (ii) 10#20#30#40#50# (iii). 10#20#30# (iv) 50#60#
2
ANS iii) ONLY MIN=0, MAX=3
2 a What do you understand by eval()?Give example. 1
ANS eval() evaluates the passed string as a Python expression and returns the result.
For example, eval("1 + 1") interprets and executes the expression "1 + 1" and
returns the result (2)
b Which is the correct form of declaration of dictionary?
v) Day=(1;’mon’, 2;’tue’, 3:’wed’)
vi) Day=[1:’ONE’, 2:’TWO’,3:’THREE’]
vii) Day={1:’APPLE’, 2:’ORANGE’, 3:’GRAPES’}
viii) Day={1’green’, 2’red’,3’blue’]
1
ANS iii) Day={1:’APPLE’, 2:’ORANGE’, 3:’GRAPES’}
c Identify the valid declaration of L:
L = [1, 23, ‘hi’, 6]
(v) List
(vi) Dictionary
(vii) Array
(viii) Tuple
1
ANS LIST
d x=['5 3 2 1']
y=['8 7 9 10']
z=y+x
print(z)
1
ANS ['8 7 9 10', '5 3 2 1']
e Find and write the output of the following python code :
def come(n):
n=n+10
1
30 | P a g e
m=5+n
n,m=m,n+m
return n,m
P=come(6)
print(P)
ANS (21, 37)
f What do you understand by UDF? What is the need of it ? 2
ANS 1 MARKS FOR USER DEFINE FUNCTION AND 1 MARKS FOR NEED OF IT
g A bar chart is drawn(using pyplot) to represent sales data of various models of
MOBILES, for a month. Write a appropriate statement in python to provide labels
MONTH-JUNE and SALES DONE to x and y axis respectively.
OR.
Give the output from the given python code:
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(1, 5)
plt.plot(x, x*1.5, label='Normal')
plt.plot(x, x*3.0, label='Fast')
plt.plot(x, x/3.0, label='Slow')
plt.legend()
plt.show()
2
ANS import matplotlib.pyplot as plt
import numpy as np
model=(‘apple’,’samsung’,’K10’,’vivo’,’nokia’)
y_pos=np.arange(len(model))
sale=[12000,12174,9000,11520,8060]
plt.bar(y_pos,sale,align=’center’,alpha=0.5)
plt.xticks(y_pos,model)
plt.xlabel(‘Month-June’)
plt.ylabel(‘Sale done’)
plt.title(‘Sales Bar Graph’)
plt.show()
OR
h Write a function in python to count the number of vowels in a text file data.txt?
OR.
Write a function DISPLAY() in python to read and count the word ‘THIS’ from
“NOVEL.TXT”.
2
ANS f=open('data.txt','r')
c=0
for k in f.read():
31 | P a g e
if k=='a' or k=='e' or k=='i' or k=='o' or k=='u':
print (k)
c=c+1
print (c)
f.close()
OR
f=open('NOVEL.txt','r')
c=0
for k in f.readlines():
for r in k.split():
if r=="THIS" or r=="this":
print(k)
c=c+1
print(c)
f.close()
i Write a function “perfect()” that determines if parameter number is a perfect
number. Use this function in a program that determines and prints all the perfect
numbers between 1 and 100.
[An integer number is said to be “perfect number” if its factors, including 1(but
not the number itself), sum to the number. E.g., 6 is a perfect number because
6=1+2+3].
OR.
Differentiate between Bubble shot and Insertion sort. Which one is better?
3
ANS def perfect(n):
sum = 0
for i in range(1,n):
if n%i == 0:
sum = sum + i
if sum == n:
return True
else:
return False
for i in range(1,1001):
if perfect(i):
print(i)
OR
2 MARKS FOR DIFFERENCE AND 1 MARKS FOR DEFINE THE BEST
j Write a function in python, AddQ(Arr) and RemoveQ(Arr) for performing
insertion and deletion operations in a Queue. Arr is the list used for
implementing queue and data is the value to be inserted.
OR.
Write a function in python, SPush(package) and SPop(package) to add a new
Package and delete a Package from a List of Package Description, considering
them to act as push and pop operations of the Stack data structure.
4
def AddQ(Arr):
data=int(input("enter data to be inserted: "))
Arr.append(data)
32 | P a g e
def RemoveQ(Arr):
if (Arr==[]):
print( "Queue empty")
else:
print ("Deleted element is: ",Arr[0])
del(Arr[0])
OR
def SPush(Package):
a=int(input("enter package title : "))
Package.append(a)
def SPop(Package):
if (Package==[]):
print( "Stack empty")
else:
print ("Deleted element:",Package.pop())
SECTION-B
Q.3 a ………………….. is an example of cloud. 1
ANS Google Drive or any other correct example
b ………………….. is a network of physical objects embedded with electronics,
software, sensors and network connectivity.
1
ANS The internet of things OR Internet
c ………………….. is a device to connect two dissimilar network. 1
ANS Router
d ………………….. describes the measuring unit of data transfer rate . 1
ANS megabit per second
e Give the full forms of the following :
(v) SMTP
(vi) SIM
(vii) Lifi
(viii) GPRS
2
ANS SIMPLE MAIL TRANSFER PROTOCOL
SUBSCRIBER IDENTITY MODULE OR SUBSCRIBER IDENTIFICATION MODULE
LIGHT FIDILITY
GENERAL PACKET RADIO SERVICES
f How many pair of wires are there in a twisted pair cable (Ethernet)? What is the
name of the port, which is used to connect Ethernet cable to a computer or a
laptop?
2
ANS TWO INSULATED COPPER WIRES , ETHERNET PORT
g Identify the type of cyber crime for the following situations:
(iv) A person complains that Rs. 4.25 lacs have been fraudulently stolen from
his/her account online via some online transactions in two days using NET
BANKING.
(v) A person complains that his/her debit/credit card is safe with him still
somebody has done shopping /ATM transaction on this card.
3
33 | P a g e
(vi) A person complains that somebody has created a fake profile of Facebook
and defaming his/her character with abusive comments and pictures.
ANS (i) Bank Fraud
(ii) Identity Theft
(iii) Cyber Stalking
h SHARMA Medicos Center has set up its new center in Dubai. It has four buildings
as shown in the diagram given below:
Distance between various building are as follows:
As a network expert, provide the best possible answer for the following queries:
i) Suggest a cable layout of connections between the buildings.
ii) Suggest the most suitable place (i.e. buildings) to house the server of this
organization.
iii) Suggest the placement of the following device with justification:
a) Repeater b) Hub/Switch
iv) Suggest a system (hardware/software) to prevent unauthorized access to or
from the network.
4
ANS 1 MARKS FOR EACH CORRECT ANS
SECTION-C
4. a Which command is used to open the database “SCHOOL”? 1
ANS USE SCHOOL
b Which clause is used to sort the records of a table? 1
ANS ORDER BY
34 | P a g e
c Which clause is used to delete the table? 1
ANS DROP
d Which clause is used to remove the duplicating rows of the table? 1
ANS Distinct
e Differentiate between Django GET and POST method. 2
ANS GET and POST. GET and POST are the only HTTP methods to use when dealing with
forms. Django's login form is returned using the POST method, in which the
browser bundles up the form data, encodes it for transmission, sends it to the
server, and then receives back its response. Both of these are dictionary-like
objects that give you access to GET and POST data. POST data generally is
submitted from an HTML <form> , while GET data can come from a <form> or the
query string in the page's URL.
f Define degree and cardinality. Based upon given table write degree and
cardinality.
2
ANS No of attributes called degree and no. of tuples called cardinality.
4 degree , 5 cardinality
g TABLE NAME : PHARMADB
Write commands in SQL for (i) to (iv):
J. To increase the price of “Amlodipine” by 50.
JJ. To display all those medicines whose price is in the range 100 to 150.
JJJ. To display the Maximum price offered by pharmacy located in “Gurgaon”
IV. To display sum of price for each PharmacyName having more than 1 drug.
RxID DrugID DrugName Price PharmacyName PharmacyLocation
R1000 5476 Amlodipine 100.00 Rx Pharmacy Pitampura, Delhi
R1001 2345 Paracetamol 15.00 Raj Medicos
Bahadurgarh,
Haryana
R1002 1236 Nebistar 60.00 MyChemist Rajouri Garden, Delhi
R1003 6512 VitaPlus 150.00 MyChemist Gurgaon,Haryana
R1004 5631 Levocitrezine 110.00 RxPharmacy South Extension,Delhi
7
35 | P a g e
VI To display Average price
Write the output(s) produced by executing the following queries:
iii) SELECT RxID, Price from PharmaDB where PharmacyNa IN (“Rx Parmacy”,
“Raj Medicos”);
iv) SELECT PharmacyName, COUNT(*) FROM PharmaDB GROUP BY
PHARMACY NAME
ANS 1) Update pharmadb set price =price+50
2) Select DrugName from Pharmadb where price>=100 and price<=150
3) Select Max(price) form pharmadb where pharmacylocation like
“Gurgaon%”
4) Select sum(price) from pharmadb group by pharmacyname having
count(*)>1
5) Select avg(Price) from pahramadb
6) R1000 100
R001 15
R1004 110
7) Rx Pharmacy 2
Raj Medicos 1
MyChemist 2
SECTION-D
5 a When net is showing the ads related to products you have bought earlier,
phenomenon is known as -----------.
1
ANS HeadOn
b As a citizen of India, what advice you should give to others for e-waste disposal? 1
ANS As a citizen of india , We can advice the following principle of waste
management:
Reduce , Reuse and Recycle.
c What are the two methods to avoid illegal downloading? 2
ANS Legal & Enforcement, Cooperation
d Define the term Phishing and Vishing ? 2
ANS Voice phishing, or “vishing”, works the same way as a spear phishing attack (by
using personalized information to leverage trust), but uses a different channel:
the telephone. The scammer calls an individual, pretending to be calling for a
trusted organization (like the bank or your credit card company).
e Stealing someone’s intellectual work and representing it as your own known as:-
(i) phishing
(ii) scam
(iii) plagiarism
(iv) intellectual property
2
ANS phishing
f What are intellectual property rights? Why should intellectual property rights be
protected?
2
36 | P a g e
ANS Intellectual property rights are the rights given to persons over the creations of
their minds. They usually give the creator an exclusive right over the use of his/her
creation for a certain period of time.

More Related Content

Similar to Sample Questions for XII Computer Science (2).pdf (20)

PDF
CS_PQMS.pdf
justforwatching72
 
DOCX
computer science file (python)
aashish kumar
 
PDF
Constructs and techniques and their implementation in different languages
OliverYoung22
 
PDF
Python cheatsheat.pdf
HimoZZZ
 
PDF
2015 syllabus 12_computer_science_new
1oshane
 
PPTX
Presentation1 (1).pptx
BodapatiNagaeswari1
 
PPT
Python Unit I MCQ.ppt
CUO VEERANAN VEERANAN
 
PDF
GE3151 PSPP All unit question bank.pdf
Guru Nanak Technical Institutions
 
PDF
Cbse marking scheme 2006 2011
Praveen M Jigajinni
 
PPTX
Python Basis Tutorial
md sathees
 
PDF
xii cs practicals
JaswinderKaurSarao
 
PDF
Computer science sqp
B Bhuvanesh
 
PDF
syllabusCS.pdf
Rashmi69422
 
PPTX
Python Workshop - Learn Python the Hard Way
Utkarsh Sengar
 
DOCX
Sample-Program-file-with-output-and-index.docx
hariharasudan456
 
PPTX
Python.pptx
AshaS74
 
DOC
Sp 1418794917
lakshmi r
 
PDF
XII CS QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SET-II.pdf
kvfwteachers
 
PDF
class 12 computer science pdf of class e
rajadityaasingh22
 
PDF
Test Bank for Fundamentals of Python First Programs, 1st Edition
zenattoylan
 
CS_PQMS.pdf
justforwatching72
 
computer science file (python)
aashish kumar
 
Constructs and techniques and their implementation in different languages
OliverYoung22
 
Python cheatsheat.pdf
HimoZZZ
 
2015 syllabus 12_computer_science_new
1oshane
 
Presentation1 (1).pptx
BodapatiNagaeswari1
 
Python Unit I MCQ.ppt
CUO VEERANAN VEERANAN
 
GE3151 PSPP All unit question bank.pdf
Guru Nanak Technical Institutions
 
Cbse marking scheme 2006 2011
Praveen M Jigajinni
 
Python Basis Tutorial
md sathees
 
xii cs practicals
JaswinderKaurSarao
 
Computer science sqp
B Bhuvanesh
 
syllabusCS.pdf
Rashmi69422
 
Python Workshop - Learn Python the Hard Way
Utkarsh Sengar
 
Sample-Program-file-with-output-and-index.docx
hariharasudan456
 
Python.pptx
AshaS74
 
Sp 1418794917
lakshmi r
 
XII CS QUESTION BANK FOR BRIGHT STUDENTS CHAPTER WISE SET-II.pdf
kvfwteachers
 
class 12 computer science pdf of class e
rajadityaasingh22
 
Test Bank for Fundamentals of Python First Programs, 1st Edition
zenattoylan
 

Recently uploaded (20)

PPTX
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
PDF
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
PPTX
THE TAME BIRD AND THE FREE BIRD.pptxxxxx
MarcChristianNicolas
 
PDF
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
PPT
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
PDF
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
PPTX
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
PPTX
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
PPTX
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
PPSX
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
PPTX
Mathematics 5 - Time Measurement: Time Zone
menchreo
 
PDF
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
PPTX
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
PDF
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
PDF
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
PPTX
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
PPTX
Quarter1-English3-W4-Identifying Elements of the Story
FLORRACHELSANTOS
 
PPTX
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
PPTX
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
MENINGITIS: NURSING MANAGEMENT, BACTERIAL MENINGITIS, VIRAL MENINGITIS.pptx
PRADEEP ABOTHU
 
The Constitution Review Committee (CRC) has released an updated schedule for ...
nservice241
 
THE TAME BIRD AND THE FREE BIRD.pptxxxxx
MarcChristianNicolas
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 - GLOBAL SUCCESS - CẢ NĂM - NĂM 2024 (VOCABULARY, ...
Nguyen Thanh Tu Collection
 
Talk on Critical Theory, Part II, Philosophy of Social Sciences
Soraj Hongladarom
 
Chapter-V-DED-Entrepreneurship: Institutions Facilitating Entrepreneurship
Dayanand Huded
 
Unit 2 COMMERCIAL BANKING, Corporate banking.pptx
AnubalaSuresh1
 
2025 Winter SWAYAM NPTEL & A Student.pptx
Utsav Yagnik
 
STAFF DEVELOPMENT AND WELFARE: MANAGEMENT
PRADEEP ABOTHU
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
HEALTH ASSESSMENT (Community Health Nursing) - GNM 1st Year
Priyanshu Anand
 
Mathematics 5 - Time Measurement: Time Zone
menchreo
 
People & Earth's Ecosystem -Lesson 2: People & Population
marvinnbustamante1
 
Cultivation practice of Litchi in Nepal.pptx
UmeshTimilsina1
 
0725.WHITEPAPER-UNIQUEWAYSOFPROTOTYPINGANDUXNOW.pdf
Thomas GIRARD, MA, CDP
 
LAW OF CONTRACT (5 YEAR LLB & UNITARY LLB )- MODULE - 1.& 2 - LEARN THROUGH P...
APARNA T SHAIL KUMAR
 
How to Manage Large Scrollbar in Odoo 18 POS
Celine George
 
Quarter1-English3-W4-Identifying Elements of the Story
FLORRACHELSANTOS
 
Universal immunization Programme (UIP).pptx
Vishal Chanalia
 
A PPT on Alfred Lord Tennyson's Ulysses.
Beena E S
 
Ad

Sample Questions for XII Computer Science (2).pdf

  • 1. 1 | P a g e COMPUTER SCIENCE – NEW (083) SAMPLE QUESTION PAPER I (2019-20) CLASS- XII Max. Marks: 70 Time: 3 hrs General Instructions: ● All questions are compulsory. ● Question paper is divided into 4 sections A, B, C and D. ▪ Section A : Unit-1 ▪ Section B : Unit-2 ▪ Section C: Unit-3 ▪ Section D: Unit-4 SECTION A Q1 A) Which of the following is valid arithmetic operator in Python: (i) % (ii) ! (iii) > (iv) or 1 B) Identify the valid identifier name from the following (i) 9if (ii) roll_no 1 C) Name the Python Library modules which need to be imported to invoke the following functions: (i) cos() (ii) dump () 1 D) Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code. 5=k for m in range(0,k) if m%4=0: print(m*4) else: print “m+3” 2 E) Find the output of the following def textchanger(text): L = len(text) ntext=”” for i in range(0,L) : if text [i].isupper() : ntext = ntext + text[i].lower() elif text [i].isalpha() : ntext = ntext + text[i].upper() else: ntext = ntext + ‘bb’ print(ntext) textchanger(gmail@com) 2 F) Study the following program and select the possible output(s) from the options (i) to (iv) following it. Also, write the maximum and the minimum values that can be assigned to the variable Y. import random X= random.random() Y= random.randint(0,4) print(int(X),":",Y+int(X)) (i)0 : 0 (ii) 1 : 6 2
  • 2. 2 | P a g e (iii)2 : 4 (iv) 0 : 3 G) Find and write the output of the following python code: def Change(X ,Y=10): X=X+Y X=x-Y print( X,"#",Y) return (X) X=5 Y=20 X=Change(X,Y) print(X,"#",Y) Y=Change(Y) print(X,"#",Y) 3 Q2 A) Define comment in python 1 B) Identify the correct option for declaration of a tuple with single element i)(‘kv’,) ii)(5,) iii(5) iv)i ) and ii) are correct way to declare tuple 1 C) Declare a dictionary of toppers of your class with their name as keys and marks obtained as there value 1 D) Find the output of the following X=”Iamaprogrammer” print(X[2:]) print(X[3:8] 1 E) What will the following function return? def add(a,b,c): print(a+b+c) 1 F) What do you understand by actual and formal argument Differentiate between them with a python example. Or Write a recursive function rec_sum(n) where n is any natural number and function returns sum of n natural number G) Write a function in python to count the number of lines in a text file ‘SAMPLE.TXT’ which is starting with an alphabet ‘H’ . OR Write a method/function DISPLAY() in python to count number of lines from a text file SAMPLE.TEXT. 2 H) What will be the output of the following code : Import matplotlib. pyplot as plt #Plotting to our canvas plt.plot([1,2,3],[4,5,1]) #Showing what we plotted plt.show() OR Write a program to create a horizontal bar graph of following data. Add suitable labels. City Population Delhi 23456123 Mumbai 20083104 2
  • 3. 3 | P a g e Bangalore 18456123 Hyderabad 13411093 I) Compare the algorithm efficiency of linear and binary search algorithm 2 J) Write a function in Python, INS_QU(A,da) and DEL_QU(A) for performing insertion and deletion operations in a Queue. A is the list used for implementing queue and d is the value to be inserted. OR Write a function in python, Push(employee) and Pop(employee) to add and delete An employee where employee is a tuple which contains name of employee and empno considering them to act as push and pop operation of the stack data structure 4 SECTION B Q3 A) ----------- is a set of rules used for communication 1 B) -------------protocol is used for sending email 1 C) Define modulation and write name of two modulation techniques 1 D) Define IOT 1 E) Explain the working of Email 2 F) Differentiate between IPv4 and IPv6 2 G) Expand the following terms i)NFC ii)IMAP iii)CDMA iv)MAC v)VoIP vi)URL 3 H) Standard Bank has set up its new center in India for its office and web based activities. It has five buildings as shown in the diagram below: (a) Suggest a possible cable layout for connecting the buildings. (b) Suggest the most suitable place to install the server of this organization. Distance between various buildings A to B 50 Mts B to C 30 Mts C to D 30 Mts D to E 35 Mts E to C 40 Mts D to A 120 Mts D to B 45 Mts E to B 65 Mts No of computers A 55 B 180 C 60 D 55 E 70 4 A E D B C
  • 4. 4 | P a g e (c) Suggest the placement of the following devices with justification. (i.) Hub/Switch (ii.) Repeater (d) The company wants to link its head office in ‘A’ building to its Office in Sydney (i) Which type of transmission medium is appropriate for such a link? (ii) What type of network this connection result into? SECTION C Q4 A) Which command is used to create a django project i)django-admin startproject <projectname> ii)django_admin startproject <projectname> iii)django-admin start project <projectname> iv)All of these 1 B) Which of the following is not a DDL command i)Create ii)Alter iii)Delete iv)All are DDL Command 1 C) What is menat by NULL values in MYSQL 1 D) Differentiate between Char and Varchar DataTYpe 1 C) Differentiate between Primary Key and Foregin key Or Differentiate between Alter and Update Command 2 D) Explain teo types of HTTP request 2 E) Consider the following tables HOSPITAL. Give outputs for SQL queries (i) to (iii) No Name Age Department Dateofadmin Charge Sex 1 Arpit 62 Surgery 21/01/06 300 M 2 Zayana 18 ENT 12/12/05 250 F 3 Kareem 68 Orthopedic 19/02/06 450 M 4 Abhilash 26 Surgery 24/11/06 300 M 5 Dhanya 24 ENT 20/10/06 350 F 6 Siju 23 Cardiology 10/10/06 800 M 7 Ankita 16 ENT 13/04/06 100 F 8 Divya 20 Cardiology 10/11/06 500 F 9 Nidhin 25 Orthopedic 12/05/06 700 M 10 Hari 28 Surgery 19/03/06 450 M i) Select SUM(Charge) from HOSPITAL where Sex=’F’; (ii) Select COUNT(DISTINCT Department ) from HOSPITAL; (iii) Select SUM(Charge) from HOSPITAL group by Department; 3 F) Consider the tables ITEMS & COMPANY. Write SQL commands for the statements (i) to (iv) and give the outputs for SQL queries (v) to (viii). Table : ITEMS ID PNAME PRICE MDATE QTY 4
  • 5. 5 | P a g e T001 Soap 12.00 11/03/2007 200 T002 Paste 39.50 23/12/2006 55 T003 Deodorant 125.00 12/06/2007 46 T004 Hair Oil 28.75 25/09/2007 325 T005 Cold Cream 66.00 09/10/2007 144 T006 Tooth Brush 25.00 17/02/2006 455 Table : COMPANY ID COMP City T001 HLL Mumbai T008 Colgate Delhi T003 HLL Mumbai T004 Paras Haryana T009 Ponds Noida T006 Wipro Ahmedabad i)To display PNAME, PRICE * QTY only for the where price is greater than 100 ii)To display company name & city for ID= T001 and T008 iii)To delete the items produced before 2007. iv)To increase the quantity by 20 for soap and paste. SECTION D Q5 A) What are the different ways in which authentincation of a person can be performed? 2 B) Define the term open data 1 C) Write any two categories of cyber crime 2 D) Explain Phishing. 2 E) How can we recycle e-waste safely? 2 F) if someone attacks your web site, who would you complain to ? 1 COMPUTER SCIENCE – NEW (083) SAMPLE QUESTION PAPER (2019-20) CLASS- XII
  • 6. 6 | P a g e MARKING SCHEME SECTION A Q1 A) (i) % 1 B) (ii) roll_no 1 C) (i) cos() :-Math (ii) dump ():-pickle 1 D) Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code. k=5 for m in range(0,k): if m%4==0: print(m*4) else: print (m+3) 2 E) GMAILbbCOM 2 F) Mimimum value of Y=0 Maximum value of Y=4 (i)0 : 0 ( (iv) 0 : 3 2 G) 5 # 20 5 # 20 20 # 10 5 # 20 3 Q2 A) Comments are the code lines which are not executed by python interprerer It is used to make program more readable and easy to understand 1 B) iv)i ) and ii) are correct way to declare tuple 1 C) Top={‘A’:97,”B:98,’C’:99} 1 D) Find the output of the following X=”Iamaprogrammer” print(X[2:]) :maprogrammer print(X[3:8]maprog 1 E) None 1 F) Actual argument is the argument defined at the time of function calling .formal argument is used at the time of function definition.Actual argument can be a variable,or expression or literal Or def rec_sum(n): if n =1: return(1) else: return((a+rec_sum(n-1)) 2 G) def count(): f1=open(‘sample.txt’,’r’) c=0 . l1=f1.readlines() for k in l1: 2
  • 7. 7 | P a g e If k[0]==’H’ C=C+1 OR def count(): c=0 f1=open(‘sample.txt’,’r’) . l1=f1.readlines() For k in l1: C=C+1 H) OR ½ marks for import matplotlib.puplot ½ marks for creation of list ½ marks for barhfunction ½ marks for use of xticks 2 I) 1 marks for linear search and 1 foe binary search 2 J) def IN_QU(A): data=int(input("enter data to be inserted: ")) A.append(data) def DEL_QU(A): if (Arr==[]): print( "Queue empty") else: print ("Deleted element is: ",A[0]) del(A[0]) ( ½ mark insert header) ( ½ mark for accepting a value from user) ( ½ mark for adding value in list) ( ½ mark for delete header) ( ½ mark for checking empty list condition) ( ½ mark for displaying “Queue empty”) ( ½ mark for displaying the value to be deleted) ( ½ mark for deleting value from list) OR def Push(employee): a=int(input("enter package title : ")) employee.append(a) def Pop(employee): if (employee==[]): 4
  • 8. 8 | P a g e print( "Stack empty") else: print ("Deleted element:",employee.pop()) (½ mark for Push() header) ( ½ mark for accepting a value from user) ( ½ mark for adding value in list) ( ½ mark for Pop() header) ( ½ mark for checking empty list condition) ( ½ mark for displaying “Stack empty”) ( ½ mark for displaying the value to be deleted)( ½ mark for deleting the value) SECTION B Q3 A) PROTOCOL 1 B) SMTP 1 C) Modulation is the process of modulating message signal .Two Types of modulation are :Amplitude modulation and Frequency Modulation 1 D) It is the network of physical objects or things embedded with electronics,software,sensors and network connectivity which enables these objects to collect and exchange data 1 E) Email System comprises of following components • Mailer • Mail Server • Mailbox Mailer:It is also called mail program,mail application or mail client .It allows us to manage ,read and compose email Mail Server:The function of mail Server is to receive ,store and deliever the email.It is a must for mail server to be running all the time because if it crashes or is down,email can be lost Mailboxes :Mailboxes is generally a folder that contains emails and information about them. 2 F) IPV4 Internet is protocol version 4 and IP6 is Internet protocol version 6 IPv4 is 32 bit and IPv6 is 128 bit IPv6 is still in transition phase and it will expected to replace IPV4 2 G) Expand the following terms i)NFC (Near Field Communication) ii)IMAP (Internet Message Access Protocol) iii)CDMA(code division multiple access) iv)MAC(Media Access Control) v)VoIP (Voice Over Internet Protocol) vi)URL(Uniform resourse locator) 1/2×6=3 H) a) 1+1+1+1 A B C
  • 9. 9 | P a g e b)Building B c) i)Hub/Switch is placed in each building ii)Repeater is placed between D TO A d)i)Satellite Communication ii)WAN SECTION C Q4 A) I)django-admin startproject <projectname> 1 B) iii)Delete 1 C) NULL value means empty value 1 D) Char is fixed length width but varchar is variable length width 1 C) i)Primary key is the key which uniquely identifies a tuple but foreign key is the key which takes reference from primary key ii)There is only one primary key in a table but there can be multiple foreign key on a table iii)Primary key is not NULL but Null can be allowed in foreign key iv)primary key must be unique but duplicate values are not allowed in primary key Or Alter command in DDL command but update command is DML Command Alter command is used to add,modify and delete a column from the table and update command is used to make changes in the record of the table 1+1 D) 1)HTTP Get Request 2)HTTP Post Request 1 marks for each type of correct explanation 1+1 E) i)1200 ii)4 iii)1050 700 1150 1300 1+1+1 F) i)Select PNAME, PRICE * QTY from ITEMS where Price>100 ii)Select comp,city from company where ID IN(‘T001’ AND ‘T008’ iii)DELETE * from ITEMS where year(MDATE)<2007. iv)Update ITEMS Set QTY=QTY+20 where Items in (‘soap’,’paste) 1+1+1+1 SECTION D Q5 A) Passwods, Token, Biometrics, OTP 2 B) Open Data: Data that can be freely available and republished 1
  • 10. 10 | P a g e C) Cyber crime encompasses a wide range of activities, but these can generally be broken into two categories: •Crimes that target computer networks or devices: Such types of crimes include viruses and denial-of-service (DoS) attacks. •Crimes that use computer networks to advance other criminal activities: These types of crimes include cyberstalking, phishing and fraud or identity theft. 2 D) Fraudulent attempt to obtain sensitive information such as User name,Password and Credit card detail as trust worthy entity through electronic communication 2 E) (i) Use a certified e-waste recycler. (ii) Visit civic institutions. Check with your local government, schools and universities for additional responsible recycling options. (iii) Explore retail options. (iv) Donate your electronics 2 F) Complaint has to be lodged under IT Act. 1 SAMPLE PAPER II 2019-20
  • 11. 11 | P a g e COMPUTER SCIENCE(083) – XII Time allowed : 3 hours Maximum Marks : 70 SECTION A 1 a Differentiate between List and Tuple. 1 b What would be the Output? STRING="WELCOME NOTE” for S in range(0,7): print (STRING[S]) print (S,STRING) 1 c Find error in the following code and correct code by rewriting it and underlining the corrections. X=int(“Enter value for x:”)) for in range[0,11]: if x=y print (x+y) else : Print (x-y) 2 d Which of the following are valid keywords in Python: (i) Elif (ii) for (iii) While (iv) if 1 e Convert the following for loop into while loop: for k in range(10,20,5): print (k) 1 f Name the Python Library modules which need to be imported to invoke the following functions : (i) sqrt() (ii) randint() 1 g Rewrite the following code in python after removing all syntax error(s). Underline each correction done in the code. if n==0 print(“zero”) elif n==1: print(“one”) elif n==2: print(“two”) else n==3: 2
  • 12. 12 | P a g e print(“three”) h Write the output of the following python code: def ChangeList(): L=[] L1=[] L2=[] for i in range(1,10): L.append(i) for i in range(10,1,2): L1.append(i) for i in range(len(L1)): L2.append(L1[i]+L[i]) L2.append(len(L)-len(L1)) print(L2) ChangeList() 3 2 a Write a function to find factorial of a number using recursion. 2 b What possible output(s) are expected to be displayed on screen at the time of execution of the program from the following code ? Also specify the maximum values that can be assigned to each of the variables BEGIN and LAST. import random POINTS=[20,40,10,30,15]; POINTS=[30,50,20,40,45]; BEGIN=random.randint(1,3) LAST=random.randint(2,4) for C in range(BEGIN,LAST+1): print( POINTS[C],"#") (i) 20#50#30# (ii) 20#40#45# (iii) 50#20#40#45# (iv) 30#50#20# 2 c Find and write the output of the following Python code: Data = ["P",20,"R",10,"S",30] Times = 0 Alpha = "" Add = 0 for C in range(1,6,2): Times = Times + C Alpha = Alpha + Data[C-1]+"$" 2
  • 13. 13 | P a g e Add = Add + Data[C] print( Times,Add,Alpha) d Suppose L=[“abc”,[6,7,8],3,”mouse”] then L[ : :2] is i) [ “abc”,[6,7,8] ] ii) [ “abc “ , 3] iii) [3, ] iv) [“abc”,[6,7,8],3,”mouse”] 1 e Write a method add, delete and display records using list implementation through stack 3 f Differentiate Local variable with Global variable. 1 g Write a Python Program to plot line chart for values x=[1,2,3,4,5]y=[65,45,76,26,80] 2 h Write a function in python to count number of lines starting with letter ‘K’ from text file ‘record.txt’ 2 i Define a function display ( ) in python to print those records from binary file ‘db.dat’ of employees whose salary is >20000. [Each Record has fields Name & Salary separated by [ : ] ] 3 SECTION B 3 a Expand the following (i)PPP (ii) TDMA (iii)TCP/IP (iv) VOIP 2 b What is MAC address ? Give example. 2 c What is Cloud Computing? Write two advantages of Cloud Services. 2 d Name the network tools used in the given situation (i) to troubleshoot internet connection problem (ii) to see the IP address associated with a domain name (iii) to look up registration record associated with a domain name (iv) to test the speed of internet connection 2 e Define the terms i) Cladding ii) attenuation iii) Telnet 3 g ABC company is planning to set up their new offices in India with its hub at Hyderabad . As a Network advisor ,understand their requirements and suggest to them best solution. 4
  • 14. 14 | P a g e Block to Block distance (in Meters): Block From Block Distance Human Resource Conference 60 Human Resource Finance 60 Conference Finance Expected Number of Computer installed in each building block: Block Computer Human Resource 125 Finace 25 Confrence 60 i) What is the most suitable block to install server? ii) What will be the best possible connectivity out of the following to connect its new office in Bengaluru With its London-based office ? i)Infrared ii)Satellite iii) Ethernet Cable iii) Which of the following devices will you suggest to connect each computer in each of the above blocks? i) Gateway ii) Switch iii) Modem iv) Write the name of any two popular Open Source Software which are used as Operating Systems. SECTION C 4 a What is the command to install Django? 1 b What is the difference between between GET and POST method? 2 c What is NULL Value ? 1 d Write python-mysql connectivity to retrieve all the data of table student 2 e Differentiate between Degree and Cardinality. 2
  • 15. 15 | P a g e f In a Bank’s database, there are two tables ‘Customer’ and ‘Transaction’ as shown below. Table : Customer Acc_No Cust_Name Cust_City Cust_Phone Open_Bal 2101001 Sunita Ambala 9710557614 10000 2201002 Sandhya Patna 8223545233 15000 2301003 Vivek New Delhi 9972136576 13000 2401004 Meena New Delhi 9321305453 10000 Table :Transaction Trans_Id Acc_No Transaction_Type Amount Tr001 2301003 Credit 15000 Tr002 2201002 Credit 20000 Tr003 2101001 Debit 3500 Tr004 2301003 Credit 26000 Tr005 2301003 Credit 24000 6 1 Write a query to display customer’s name who has withdrawn the money. 2 Write a query to display customer’s name along with their transaction details. 3 Write a query to display customer’s name who have not done any transaction yet. 4 How many rows and column will be there in the Cartesian product of the above given tables. Also mention the degree and cardinality of the Cartesian product of the above given tables. 5 Select Acc_No, sum(Amount) from Customer c, Transaction t where c.Acc_No=t.Acc_No group by c.Acc_No having Transaction_Type="Credit"; 6 Discuss the significance of having clause with group by statement with suitable example. SECTION D 5 a What are Intellectual Property Rights (IPR)? 1
  • 16. 16 | P a g e b Differentiate between open source software and free software 2 c What is online fraud? 2 d What do you understand by plagiarism? 2 e How does phishing happen? 2 f if someone attacks your web site, who would you complain to ? 1
  • 17. 17 | P a g e MARKING SCHEME SAMPLE PAPER II 2019-20 SECTION A 1 a List in python represents a group of comma separated values of any datatype between square brackets. eg [“neha”,42,12.56] Tuples are represents a group of comma separated values of any datatype within parentheses. eg ( 1,2,3,4,5) 1 b W E L C O M E 6 WELCOMENOTE 1 mark for correct output 1 c x=int(input(“Enter value for x:”)) for y in range(0,11): if x==y : print ( x+y) else : print ( x-y ) 2 Marks for removal of all errors (1/2 Marks for each corrected line) 2 d valid keywords in Python: (i) for (iv) if 1/2 Marks for each corrected 1 e 1 mark for complete correct while conversion (1/2 for partial corrected loop) 1 f (i) math (ii) random 1/2 mark for each option 1 g n=0 if n==0: 2
  • 18. 18 | P a g e print(“zero”) elif n==1: print(“one”) elif n==2: print(“two”) else : print(“three”) 2 Marks for removal of all errors (1/2 Marks for each corrected line) h [11, 10, 9, 8, 7, 4] (3 marks for correct output. Partial marking can also be given) 3 2 a 1 mark for correct logic ½ mark for correct if statement and ½ mark for writing recursive call 2 b (ii) 20#40#45# (iii) 50#20#40#45# Minimum value for BEGIN:1 Minimum value for LAST:2 (1 Mark for writing the correct options) (½ Mark for writing each correct Minimum value of BEGIN AND LAST) 2 c 1 20 P$ 4 30 P$R$ 9 60 P$R$S$ (2 marks for correct output. ) 2 d ['abc', 3] (1 mark for correct answer) 1 e s=[] c=’y’ while( c==’y’): print(“ 1 for Push”) print(“ 2 for Pop”) print(“ 3 for display”) choice=int(input(“Enter your choice”)) if(choice==1): a=int(input(“Enter a number”)) s.append(a) 3
  • 19. 19 | P a g e elif (choice==2): if s==[ ] : print(“Stack is empty”) else: print(“Deleted element is :” s.pop()) elif (choice==3): l=len(s) for i in range(l-1,-1,-1): print(s[i]) else: print (“Wrong input”) c=input(“do you want to continue y or n ”) f 1/2 mark for each correct definition 1 g import matplotlib.pyplot as plt import numpy as np x=[1,2,3,4,5] y=[65,45,76,26,80] plt.plot(x,y) plt.xlabel("X axis") plt.ylabel("Y axis ") plt.title("Graph for x=[1,2,3,4,5] y=[65,45,76,26,80]") plt.show() 2 mark for correct answer 2 h f=open(“record.txt”,”r”) (1+1=2) lines=0 l=f.readlines() for i in I: if i[0]==’K’ lines=lines+1 print(“No of Lines:”,lines) 2 mark for correct answer 2 i def display(): i=open(“db.dat” , rb+”) x=i.readlines() while (x): I=x.split(‘:’) if I[2]>20000: print(x) x=i.readlines() i.close() 3 mark for correct answer, partial marks can be given. 3
  • 20. 20 | P a g e SECTION B 3 a PPP: Point to Point Protocol TDMA:Time division multiple Access TCP/IP: Transmission Control Protocol/Internet Protocol 2 VOIP:Voice Over Internet Protocol ½ marks for each correct expansion b Medium access control Physical Address of NIC Card assigned by manufacturer stored on ROM. (1+1=2) e.g 00:0d:83:b1:c0:8e 1 mark for correct definition and 1 mark for example 2 c Cloud computing is an internet based new age computer technology. It is the next stage technology that uses the cloud to provide the services whenever and wherever the user needs it. It provides a method to access several servers worldwide Two advantages of Cloud Computing: i) Data backup and storage ii) Powerful server capability 2 marks for correct explanation. 2 d (i) ping (ii) nslookup (iii) whois (iv) speedtest.net ½ mark for each correct answer 2 e Cladding: Layer of glass surrounded the Centre fibre of glass in fibre optics cable. Attenuation: Degeneration of signal over a distance on network cable. Telnet: Service to log in remotely on any computer over network. ½ mark for each correct line (Max 2 marks for correct answer) 3 g i)Human Resource Block ii) Ethernet Cable iii) Switch iv) Linux and Open Solaris 1 mark for each correct answer 4 SECTION C 4 a pip install django ( 1 mark for correct answer) 1 b 1 mark for each correct answer 2
  • 21. 21 | P a g e c NULL value is value in table with blank field 1 d import mysql.connector mydb=mysql.connector.connect(user="root",host="localhost",passw d="123",database="inservice") mycursor=mydb.cursor() mycursor.execute("select * from student") for x in mycursor: print(x) 2 marks for correct statements 2 e 2 marks for correct difference 2 f 1 Select cust_name from customer c,transaction t where c.Acc_No=t.Acc_No and Transaction_Type= "Debit"; 1 2 Select cust_name, t.* from customer c, transaction t where c.Acc_No = t.Acc_No; 1 3 Select cust_name from customer c,transaction t where c.Acc_No!=t.Acc_No; 1 4 Cartesian Product Number of Rows: 20 Number of Columns: 9 Degree: 9 Cardinality: 20 1 5 2301003 65000 2201002 20000 1 6 select Acc_No, sum(Amount) from Customer c, Transaction t where c.Acc_No=t.Acc_No group by c.Acc_No having Transaction_Type="Credit"; 1 SECTION D 5 a IPR is a general term covering patents, copyright, trademark, industrial designs, geographical indications, layout design of integrated circuits, undisclosed information (trade secrets) and new plant varieties. 1 mark for correct definition 1 b 1 mark for each correct definition 2 c Fraud committed using the internet call online fraud. Online fraud my occur in many forms such as non-delivered goods, non-existent companies, stealing information, fraudulent payments etc. 2 d 2 marks for correct answer 2
  • 22. 22 | P a g e e Phishing is typically carried out by email spoofing or instant messaging and it often directs users to enter personal information at a fake website, the look and feel of which is identical to the legitimate one and the only difference is the URL of the website in question 2 f Complaint has to be lodged under IT Act 1
  • 23. 23 | P a g e SAMPLE PAPER III SUBJECT COMPUTER SCIENCE (XII-083) Time 3hrs M.M. 70 1 a) Which of the following is valid operator in python : I ) % 2) **= 3) < 4) not 1 b) Write the type of tokens from the following : 1) for 2)_fn 1 c) Nam the python library modules which need to be imported to invoke the following functions: 1) sin() 2) randint() 1 d) Rewrite the following code in python after removing all syntax error(s).underline each correction done in code. O,P= 10=20 for j n range[O,P]: print(p*4) T= p+5 Print(T) 2 e) Find and write the output: def solve(s1): k=len(s1) s2='' for j in range (0,k): if s1[j].isupper(): s2=s2+s1[j+1].lower() elif s1[j].islower(): s2=s2+s1[j-1].upper() else: s2=s2+'@' print(s2) solve('WeLcoMe') 2 f) Find and write the output of the following python code: def update(p,q=10): p=p+q q=p-q print(p,”#”,q) return (p) p1=40 q1=20 p1=update(p1,q1) print(r,”@”,q1) q1=update(q1) 3 g) What possible outputs are expected to be displayed on the screen at the time of execution of the program from the following code? Also specify the minimum and maximum values that can be assigned to the variable c. 2
  • 24. 24 | P a g e import random temp=[10,20,30,40,50,60] c=random.randint(0,4) for I in range(0, c): print(temp[I],'#',end='') (i) #10#20 (ii) 10#20#30#40#50# (iii). 10#20#30# (iv) 50#60# 2 a What do you understand by eval()? 1 b Which is the correct form of declaration of dictionary? i) Day=(1;’mon’, 2;’tue’, 3:’wed’) ii) Day=[1:’ONE’, 2:’TWO’,3:’THREE’] iii) Day={1:’APPLE’, 2:’ORANGE’, 3:’GRAPES’} iv) Day={1’green’, 2’red’,3’blue’] 1 c Identify the valid declaration of L: L = [1, 23, ‘hi’, 6] (i) List (ii) Dictionary (iii) Array (iv) Tuple 1 d Find and write the output of the following python code: x=['5 3 2 1'] y=['8 7 9 10'] z=y+x print(z) 1 e Find and write the output of the following python code : def come(n): n=n+10 m=5+n n,m=m,n+m return n,m P=come(6) print(P) 1 f What do you understand by UDF? What is the need of it ? 2 g A bar chart is drawn(using pyplot) to represent sales data of various models of MOBILES, for a month. Write a appropriate statement in python to provide labels MONTH-JUNE and SALES DONE to x and y axis respectively. OR. Give the output from the given python code: import matplotlib.pyplot as plt import numpy as np x = np.arange(1, 5) plt.plot(x, x*1.5, label='Normal') plt.plot(x, x*3.0, label='Fast') 2
  • 25. 25 | P a g e plt.plot(x, x/3.0, label='Slow') plt.legend() plt.show() h Write a function in python to count the number of vowels in a text file data.txt? OR. Write a function DISPLAY() in python to read and count the word ‘THIS’ from “NOVEL.TXT”. 2 i Write a function “perfect()” that determines if parameter number is a perfect number. Use this function in a program that determines and prints all the perfect numbers between 1 and 100. [An integer number is said to be “perfect number” if its factors, including 1(but not the number itself), sum to the number. E.g., 6 is a perfect number because 6=1+2+3]. OR. Differentiate between Bubble shot and Insertion soRt. Which one is better? 3 j Write a function in python, AddQ(Arr) and RemoveQ(Arr) for performing insertion and deletion operations in a Queue. Arr is the list used for implementing queue and data is the value to be inserted. OR. Write a function in python, SPush(package) and SPop(package) to add a new Package and delete a Package from a List of Package Description, considering them to act as push and pop operations of the Stack data structure. 4 SECTION-B Q.3 a ………………….. is an example of cloud. 1 b ………………….. is a network of physical objects embedded with electronics, software, sensors and network connectivity. 1 c ………………….. is a device to connect two dissimilar network. 1 d ………………….. describes the measuring unit of data transfer rate . 1 e Give the full forms of the following : (i) SMTP (ii) SIM (iii) Lifi (iv) GPRS 2 f How many pair of wires are there in a twisted pair cable (Ethernet)? What is the name of the port, which is used to connect Ethernet cable to a computer or a laptop? 2 g Identify the type of cyber crime for the following situations: (i) A person complains that Rs. 4.25 lacs have been fraudulently stolen from his/her account online via some online transactions in two days using NET BANKING. (ii) A person complains that his/her debit/credit card is safe with him still somebody has done shopping /ATM transaction on this card. (iii) A person complains that somebody has created a fake profile of Facebook and defaming his/her character with abusive comments and pictures. 3 h Sharma Medicos Center has set up its new center in Dubai. It has four buildings as shown in the diagram given below: 4
  • 26. 26 | P a g e Distance between various building are as follows: As a network expert, provide the best possible answer for the following queries: i) Suggest a cable layout of connections between the buildings. ii) Suggest the most suitable place (i.e. buildings) to house the server of this organization. iii) Suggest the placement of the following device with justification: i. a) Repeater b) Hub/Switch iv) Suggest a system (hardware/software) to prevent unauthorized access to or from the network. SECTION-C Q4. a Which command is used to open the database? 1 b Which clause is used to sort the records of a table? 1 c Which command is used to delete the table? 1 d Which clause is used to remove the duplicating rows of the table? 1 e Differentiate between Django GET and POST method. 2 f Define degree and cardinality. Based upon given table write degree and cardinality. 2 g RxID DrugID DrugName Price PharmacyName PharmacyLocation R1000 5476 Amlodipine 100.00 Rx Pharmacy Pitampura, Delhi R1001 2345 Paracetamol 15.00 Raj Medicos Bahadurgarh, Haryana R1002 1236 Nebistar 60.00 MyChemist Rajouri Garden, Delhi R1003 6512 VitaPlus 150.00 MyChemist Gurgaon,Haryana 7
  • 27. 27 | P a g e Write commands in SQL for (i) to (iv): I. To increase the price of “Amlodipine” by 50. II. To display all those medicines whose price is in the range 100 to 150. III. To display the Maximum price offered by pharmacy located in “Gurgaon” IV. To display sum of price for each PharmacyName having more than 1 drug. VI To display Maximum and Minimum price Write the output(s) produced by executing the following queries: i) SELECT RxID, Price from PharmaDB where PharmacyNa IN (“Rx Parmacy”, “Raj Medicos”); ii) SELECT PharmacyName, COUNT(*) FROM PharmaDB GROUP BY PHARMACY NAME R1004 5631 Levocitrezine 110.00 RxPharmacy South Extension,Delhi SECTION-D 5 a When net is showing the ads related to products you have bought earlier, phenomenon is known as -----------. 1 b As a citizen of India, what advice you should give to others for e-waste disposal? 1 c What are the two methods to avoid illegal downloading? 2 d Define the term Phishing and Vishing ? 2 e Stealing someone’s intellectual work and representing it as your own known as:- (i) phishing (ii) scam (iii) plagiarism (iv) intellectual property 2 f What are intellectual property rights? Why should intellectual property rights be protected? 2 END OF THE THE PAPER
  • 28. 28 | P a g e MARKING SCHEME SAMPLE PAPER III- XII CS Time 3hrs M.M. 70 1 a) Which of the following is valid operator in python : I ) % 2) AND 3) => 4) **= 1 ANS % , **= b) Write the type of tokens from the following : 1) for 2)_fn 1 ANS CONTROL FLOW , IDENTIFIER c) Nam the python library modules which need to be imported to invoke the following functions: 1) sin() 2) randint() 1 ANS MATH , RANDOM d) Rewrite the following code in python after removing all syntax error(s).underline each correction done in code. O,P= 10=20 for j n range[O,P]: print(p*4) T= p+5 Print(T) 2 ANS O,P= 10,20 for j n range(O,P): print(P*4) T= P+5 Print(T) e) Find and write the output: def solve(s1): k=len(s1) s2=” “ for j in range (0,k): if (s1[i].isupper()) s2=s2+s1[j+1].lower() elif s1[i].islower() s2=s2+s1[j-1].upper() else: s2=s2+”@” print(s2) solve(“WeLcoMe”) 2 ANS eWcLCeM f) Find and write the output of the following python code: def update(p,q=10): p=p+q q=p-q print(p,'#',q) return (p) 3
  • 29. 29 | P a g e p1=40 q1=20 p1=update(p1,q1) print(p1,'@',q1) q1=update(q1) ANS 60 # 40 60 @ 20 30 # 20 g) What possible outputs are expected to be displayed on the screen at the time of execution of the program from the following code? Also specify the minimum and maximum values that can be assigned to the variable c. import random temp=[10,20,30,40,50,60] c=random.randint(0,4) for I in range(0, c): print(temp[i],’:’,end=’#‘) (i) #10#20 (ii) 10#20#30#40#50# (iii). 10#20#30# (iv) 50#60# 2 ANS iii) ONLY MIN=0, MAX=3 2 a What do you understand by eval()?Give example. 1 ANS eval() evaluates the passed string as a Python expression and returns the result. For example, eval("1 + 1") interprets and executes the expression "1 + 1" and returns the result (2) b Which is the correct form of declaration of dictionary? v) Day=(1;’mon’, 2;’tue’, 3:’wed’) vi) Day=[1:’ONE’, 2:’TWO’,3:’THREE’] vii) Day={1:’APPLE’, 2:’ORANGE’, 3:’GRAPES’} viii) Day={1’green’, 2’red’,3’blue’] 1 ANS iii) Day={1:’APPLE’, 2:’ORANGE’, 3:’GRAPES’} c Identify the valid declaration of L: L = [1, 23, ‘hi’, 6] (v) List (vi) Dictionary (vii) Array (viii) Tuple 1 ANS LIST d x=['5 3 2 1'] y=['8 7 9 10'] z=y+x print(z) 1 ANS ['8 7 9 10', '5 3 2 1'] e Find and write the output of the following python code : def come(n): n=n+10 1
  • 30. 30 | P a g e m=5+n n,m=m,n+m return n,m P=come(6) print(P) ANS (21, 37) f What do you understand by UDF? What is the need of it ? 2 ANS 1 MARKS FOR USER DEFINE FUNCTION AND 1 MARKS FOR NEED OF IT g A bar chart is drawn(using pyplot) to represent sales data of various models of MOBILES, for a month. Write a appropriate statement in python to provide labels MONTH-JUNE and SALES DONE to x and y axis respectively. OR. Give the output from the given python code: import matplotlib.pyplot as plt import numpy as np x = np.arange(1, 5) plt.plot(x, x*1.5, label='Normal') plt.plot(x, x*3.0, label='Fast') plt.plot(x, x/3.0, label='Slow') plt.legend() plt.show() 2 ANS import matplotlib.pyplot as plt import numpy as np model=(‘apple’,’samsung’,’K10’,’vivo’,’nokia’) y_pos=np.arange(len(model)) sale=[12000,12174,9000,11520,8060] plt.bar(y_pos,sale,align=’center’,alpha=0.5) plt.xticks(y_pos,model) plt.xlabel(‘Month-June’) plt.ylabel(‘Sale done’) plt.title(‘Sales Bar Graph’) plt.show() OR h Write a function in python to count the number of vowels in a text file data.txt? OR. Write a function DISPLAY() in python to read and count the word ‘THIS’ from “NOVEL.TXT”. 2 ANS f=open('data.txt','r') c=0 for k in f.read():
  • 31. 31 | P a g e if k=='a' or k=='e' or k=='i' or k=='o' or k=='u': print (k) c=c+1 print (c) f.close() OR f=open('NOVEL.txt','r') c=0 for k in f.readlines(): for r in k.split(): if r=="THIS" or r=="this": print(k) c=c+1 print(c) f.close() i Write a function “perfect()” that determines if parameter number is a perfect number. Use this function in a program that determines and prints all the perfect numbers between 1 and 100. [An integer number is said to be “perfect number” if its factors, including 1(but not the number itself), sum to the number. E.g., 6 is a perfect number because 6=1+2+3]. OR. Differentiate between Bubble shot and Insertion sort. Which one is better? 3 ANS def perfect(n): sum = 0 for i in range(1,n): if n%i == 0: sum = sum + i if sum == n: return True else: return False for i in range(1,1001): if perfect(i): print(i) OR 2 MARKS FOR DIFFERENCE AND 1 MARKS FOR DEFINE THE BEST j Write a function in python, AddQ(Arr) and RemoveQ(Arr) for performing insertion and deletion operations in a Queue. Arr is the list used for implementing queue and data is the value to be inserted. OR. Write a function in python, SPush(package) and SPop(package) to add a new Package and delete a Package from a List of Package Description, considering them to act as push and pop operations of the Stack data structure. 4 def AddQ(Arr): data=int(input("enter data to be inserted: ")) Arr.append(data)
  • 32. 32 | P a g e def RemoveQ(Arr): if (Arr==[]): print( "Queue empty") else: print ("Deleted element is: ",Arr[0]) del(Arr[0]) OR def SPush(Package): a=int(input("enter package title : ")) Package.append(a) def SPop(Package): if (Package==[]): print( "Stack empty") else: print ("Deleted element:",Package.pop()) SECTION-B Q.3 a ………………….. is an example of cloud. 1 ANS Google Drive or any other correct example b ………………….. is a network of physical objects embedded with electronics, software, sensors and network connectivity. 1 ANS The internet of things OR Internet c ………………….. is a device to connect two dissimilar network. 1 ANS Router d ………………….. describes the measuring unit of data transfer rate . 1 ANS megabit per second e Give the full forms of the following : (v) SMTP (vi) SIM (vii) Lifi (viii) GPRS 2 ANS SIMPLE MAIL TRANSFER PROTOCOL SUBSCRIBER IDENTITY MODULE OR SUBSCRIBER IDENTIFICATION MODULE LIGHT FIDILITY GENERAL PACKET RADIO SERVICES f How many pair of wires are there in a twisted pair cable (Ethernet)? What is the name of the port, which is used to connect Ethernet cable to a computer or a laptop? 2 ANS TWO INSULATED COPPER WIRES , ETHERNET PORT g Identify the type of cyber crime for the following situations: (iv) A person complains that Rs. 4.25 lacs have been fraudulently stolen from his/her account online via some online transactions in two days using NET BANKING. (v) A person complains that his/her debit/credit card is safe with him still somebody has done shopping /ATM transaction on this card. 3
  • 33. 33 | P a g e (vi) A person complains that somebody has created a fake profile of Facebook and defaming his/her character with abusive comments and pictures. ANS (i) Bank Fraud (ii) Identity Theft (iii) Cyber Stalking h SHARMA Medicos Center has set up its new center in Dubai. It has four buildings as shown in the diagram given below: Distance between various building are as follows: As a network expert, provide the best possible answer for the following queries: i) Suggest a cable layout of connections between the buildings. ii) Suggest the most suitable place (i.e. buildings) to house the server of this organization. iii) Suggest the placement of the following device with justification: a) Repeater b) Hub/Switch iv) Suggest a system (hardware/software) to prevent unauthorized access to or from the network. 4 ANS 1 MARKS FOR EACH CORRECT ANS SECTION-C 4. a Which command is used to open the database “SCHOOL”? 1 ANS USE SCHOOL b Which clause is used to sort the records of a table? 1 ANS ORDER BY
  • 34. 34 | P a g e c Which clause is used to delete the table? 1 ANS DROP d Which clause is used to remove the duplicating rows of the table? 1 ANS Distinct e Differentiate between Django GET and POST method. 2 ANS GET and POST. GET and POST are the only HTTP methods to use when dealing with forms. Django's login form is returned using the POST method, in which the browser bundles up the form data, encodes it for transmission, sends it to the server, and then receives back its response. Both of these are dictionary-like objects that give you access to GET and POST data. POST data generally is submitted from an HTML <form> , while GET data can come from a <form> or the query string in the page's URL. f Define degree and cardinality. Based upon given table write degree and cardinality. 2 ANS No of attributes called degree and no. of tuples called cardinality. 4 degree , 5 cardinality g TABLE NAME : PHARMADB Write commands in SQL for (i) to (iv): J. To increase the price of “Amlodipine” by 50. JJ. To display all those medicines whose price is in the range 100 to 150. JJJ. To display the Maximum price offered by pharmacy located in “Gurgaon” IV. To display sum of price for each PharmacyName having more than 1 drug. RxID DrugID DrugName Price PharmacyName PharmacyLocation R1000 5476 Amlodipine 100.00 Rx Pharmacy Pitampura, Delhi R1001 2345 Paracetamol 15.00 Raj Medicos Bahadurgarh, Haryana R1002 1236 Nebistar 60.00 MyChemist Rajouri Garden, Delhi R1003 6512 VitaPlus 150.00 MyChemist Gurgaon,Haryana R1004 5631 Levocitrezine 110.00 RxPharmacy South Extension,Delhi 7
  • 35. 35 | P a g e VI To display Average price Write the output(s) produced by executing the following queries: iii) SELECT RxID, Price from PharmaDB where PharmacyNa IN (“Rx Parmacy”, “Raj Medicos”); iv) SELECT PharmacyName, COUNT(*) FROM PharmaDB GROUP BY PHARMACY NAME ANS 1) Update pharmadb set price =price+50 2) Select DrugName from Pharmadb where price>=100 and price<=150 3) Select Max(price) form pharmadb where pharmacylocation like “Gurgaon%” 4) Select sum(price) from pharmadb group by pharmacyname having count(*)>1 5) Select avg(Price) from pahramadb 6) R1000 100 R001 15 R1004 110 7) Rx Pharmacy 2 Raj Medicos 1 MyChemist 2 SECTION-D 5 a When net is showing the ads related to products you have bought earlier, phenomenon is known as -----------. 1 ANS HeadOn b As a citizen of India, what advice you should give to others for e-waste disposal? 1 ANS As a citizen of india , We can advice the following principle of waste management: Reduce , Reuse and Recycle. c What are the two methods to avoid illegal downloading? 2 ANS Legal & Enforcement, Cooperation d Define the term Phishing and Vishing ? 2 ANS Voice phishing, or “vishing”, works the same way as a spear phishing attack (by using personalized information to leverage trust), but uses a different channel: the telephone. The scammer calls an individual, pretending to be calling for a trusted organization (like the bank or your credit card company). e Stealing someone’s intellectual work and representing it as your own known as:- (i) phishing (ii) scam (iii) plagiarism (iv) intellectual property 2 ANS phishing f What are intellectual property rights? Why should intellectual property rights be protected? 2
  • 36. 36 | P a g e ANS Intellectual property rights are the rights given to persons over the creations of their minds. They usually give the creator an exclusive right over the use of his/her creation for a certain period of time.