Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

MODEL FULLY

TEST SOLVED

PAPER BASED ON ANNUAL EXAMINATION PATTERN

A NIGNLY RESEMBLED SAMPLE PAPER FOR CBSE CLASS 12TH EXAMINATOM

Time allowed: 3 Hours [Maximum Marks:70

GENERAL INSTRUCTIONS
1. This question paper contains two parts A and B. Each part is compulsory
2. Both Part A and Part B have choices.
3. Part-A has 2 sections:
a. Section- is short answer questions, to be answered in one word or one line.
b. SectionH has two case study based questions. Each case study has 4 case-based subyparts.
An examinee is to attempt any 4 out of the 5 subparts.
Part-B is Descriptive Paper.
5. Part-B has three sections.
Section- is short answer questions of 2 marks each in which two questions have internal options
b. Section-l is long answer questions of 3 marks each in which two questions have internal options.
C. Section-ll is very long answer questions of 5 marks each in which one question has internal option
6. All programming questions are to be answered using Python Language only.

PART-A
SECTION-I
Select the most appropriate option out of the options given for each question. Attempt any 15 questions
from question no 1 to 21.
1. Write the type of Python Operators (Arithmetic, Logical, Augmented Assignment and Relational Operators) from
the following 1
(a) and (b)
(c) (d)
2. Given thelist Tp = (-38, -20, 0,5, 10, 15) write the output of print(Tp[1:5:21)
3. Which function of csv module is used to write a record into csv file?
4. Write the names of any two sequence data types available in 1
Python.
5. You are provided two list S1 and S2. Write the statement in the blank to update list S1 as given in Line 4 1
$1 [1.3,5,7 #Line 1
$2 12,4,6 #Line 2
#Line 3

S1 [1,3, 5, 7, [2,4, 6)] #Line 4

18
Complimentary Bookilet
17
6. Find the output of the following code
snippet: 1
car ={
"br": "Hondaa",
"mod": "Vols",

"year": 2010}

car.popitem()

print(car)
7. What will be the output of the print() statement? 1
P (8, 19, 3, 14, 8, 16, 8, 15)
print(len(P)
8. Name the Python Library module which need to be imported to invoke the following functions.
(a) sqrt()
(b) dump()
9. Write the internet service for
name sending written messages electronically from one computer to another. 1
10. Trehan opened his email and found that his inbox was full of hundreds of unwanted
mails. It took him around two
hours to delete these unwanted mails and find the relevant ones in his inbox. What may be the cause of his
receiving so many unsolicited mails? What can Trehan do to prevent this happening in future?
11. Out of the following, which clause is used immediately after select statement in SQL?
GROUP BY, ORDER BY, SELECT, WHERE
12. Write any two wild card characters that are available in SQL 1
13. Which aggregate function finds the sum of all values of a column in SQL?
14. Which of the following is a DDL command? 1

(a) SELECTS (b) ALTER


(c) INSERTS (d) UPDATE
15. What can be done to reduce the risk of identity theft?
16. ldentify the valid declaration of F:
X= (2, Two',3 Three')
(a) dictionary (b) string
(c) tuple (d) list
17. If the following code is executed, what will be the output of the following code?

P "Parrot@Green"
print(P[4:8:2])
18. Write the names of any two joins in SQL?
19. Which protocol helps us to transfer files to and from a remote computer?

20. Which key uniquely identifies a row ina table? 1

21. What is open source software? 1


18
DEEPAK CBSE Sample Paper 12th
SECTION-II
Both the case study based questions each
are
compulsory. Attempt any 4 sub parts from question. Each
question carries 1 mark.
22. Anirudh of stationery
shop has decided to maintain the billing information of iterms in the store. As the database
administrator, he has decided to maintain a database in MySql with the following information
Name of database SALES
Name of relation TRAN
Name of attributes
Id of type integer
Product of type string
Qty of type integer
Price of type integer
Transaction date of type date
TABLE TRAN
ld Product Qty Price Transaction Date
101 Plastic Folder 12" 100 3400
2014-12-14
104 Pen Stand Standard 200 4500 2015-01-31
105 Stapler Medium 250 1200 2015-02-28
109 Punching Machine Big 200 1400 2015-03-12
103 Stapler Mini 100 1500 2015-02-02

(a) ldentify the attribute or combination of atributes best suitable to


be declared as a
primary key.
(b) Write the degree and cardinality of the TABLE TRAN.
(c) Insert the following data into the TABLE TRAN with attributes value as below:
1
ld Product Qty Price Transaction Date
108 Cover 50 500 2015-04-03
(d) NowAnirudh wants to display the structure of the TABLE
TRAN i.e name of the
data attributes and their respective
types that he has used in the TABLE. Write the
query to display the same. 1
(e) Anirudh wants to remove the TABLE TRAN from
the database SALES. Which command
will he use from the
following:
(i) DROP TABLE TRAN
(i) DELETE TRAN FROM SALES
(Gi) DROP TABLE TRAN
(iv) DELETE TRAN
Complimentary Booklet
23. Gourav of class 12 is 19
writing a program to create a CSV file
entries. e has written the "Sales.csv" which will contain (vno, vnamej for some
following code. As a
programmer, help him to
import successfully execute the given task.
# Line 1

def wrFile(vno, vname) :


# to add / write
fob open( "Sales.csv", 'a',newline=' ')
Wr CSV._
(fob) #Line 2
Wr.writerow( [vno, vname])
fob.close()
#csv file
reading code
def readFile() :
with open( "Sales.csv"
_) as fob: #Line 3
dataf =

cSv.reader (fob)
for row in dataf:
print (row)
fob.
# Line 4

wrFile(2005, 'Lak Sales')


wrFile(2006, 'Pt Hardware')
readFile () #Line 5

(a) Name the module he should import in Line 1.


(b) Complete the statement in Line 2, to link Wr object.
1
(c) Fill in the blank in Line 3 to open the file for reading9.
1
(d) Fill in the blank in Line 4 to close the file.
1
(e) Write the output he will obtain while executing Line 5.

PART-B
SECTION-I

24. Evaluate thefollowing expressions 2


(a) 34//2 +5 10- 3**2
(b) x = 100

y 20
x y ) or not(x < y)
25. What kind of data get stored in ocookies and how is it useful? 2
OR

Define Firewall. Write any one hardware and software firewall


20 DEEPAK CBSE Sample Peper 12th

26. Expand the following 2


(a) GSM (b) GPRSs
(c) Wi-Fi (d) VolP

27. Write the definition of a function Pattern(MyList) in Python, to display the eiements of list twice, if it is a number

and display the element terminated with ifit is not a number. 2


Example:
Ifthe contents of list is as follows:
MyList [RAMAN', 21', YOGRAJ, '3, "TARA]
The output should be

RAMAN
2121
YOGRAJ
33

TARA
OR
What is the difference between break and continue
keywords. Give a suitable example to explain the use of both
words.
28. Rewrite the following code after removing syntax errors. Underline each correction in the following code 2
letter input('Enter any letter(A-Z))
if letter = 'a' or letter == 'e' or letter == i"

prit ('a or e or i')


ese:

print'cons')
29. 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 and minimum values that can be
assigned to variable PICKER. 2
import random
PICKER = random.randint(0,3)

COLOR [BLUE','PINK', 'GREEN, RED


for I in COLOR:
for J in range(1, PICKER): #one to Picker
print(, end ='")
print()
) (i) (i) (iv)
RED RED BLUE BLUE BLUE BLUE BLUE
PINK PINK PINK PINK PINK RED RED
GREEN GREEN GREEN PINK PINK
RED RED RED
GREEN GREEN
Complimentary Booklet
30. What are primary and 21
foreign keys? How are they related
31. (a) Which furnction is used
to each other? 2
to fetch
exactly three rows from the buffer storing the resultant
of cursor.execute() statement? rows after execution
i) fetchone() 2

(i) fetchmany(3)
(ii) fetchall()
(b) How fetchone( ) function works?
32. Write the full form of DDL and
DML in SQL. Give one example of DDL command and one of DML command. 2
33. Find the output of
the following Python code
Data ["U", 20, "V",
10,'"W", 30]
Times = 0

Alpha =

Add e
for C in range(1,6,2) :
Times = Times + C

Alpha Alpha + Data[C-1]+"$°"


Add =
AddData [C]

print (Times, Add, Alpha)


SECTION-II

34. Write a function FEnding(SCORES) to find the sum of numbers ending with 4. The numbers are stored in the list

SCORES. 3

For example
Input List contains the following elements:

SCORES = [25,36,54,86,94]

Output
Sum of numbers ending with 4 are: 148
35. Write a method/function CountLin() in python to read lines from a text file 'Wonder.TXT, and display lines starting
3
with letter 'C' or 'c'.
are as follows:
If the "Wonder.TXT" contents

The Great Wall of China, China


Chichén Itza, Mexico

Christ The Redeemer, Brazil

Petra, Jordan
Taj Mahal, India

Colosseum, Italy
22 DEEPAK CBSE Sample Paper 12
Machu Picchu
The Great Pyramid of Giza, Egypt
Colossus of Rhodes, Greece
Lighthouse of Alexandria, Egypt

Output:

ChichAOn Itza, Mexico


Christ The Redeemer, Brazil
Colosseum, Italy
Colossus of Rhodes, Greece

OR
Write a function
Lettc() in python to count the occurrence of letter' or 'R' in the text file 'Birbal.TXT.
If the file contents are as follows:

The Crows in The


Kingdom
On one fine sunny day, Akbar and Birbal
were taking
leisurely walk in the palace gardens. Suddenly, Akbar
a
thought of testing Birbal's wits
by asking him a tricky
question. Emperor asked Birbal, "How many crows are
there in our kingdom?" Birbal could
sense the amusement in the
king's voice and within a few minutes Birbal
replied, "My king, there are eighty thousand nine hundred and
seventy-one crows in our kingdom".
The LettCount() function should display the output as:

Occurrence of letter r or R in the text 24


36. Writea output for SQL queries (a) to (c), which are based on the table
TABLE SHOPPE
ld SName Area
S001 ABC Computronics CP
SO02 All Infotech Media GK II
S003 Tech
Shoppe CP
S004 Geeks Techno Soft Nehru Place
S005 Hitec Tech Store Nehru Place
(a) SELECT COUNT(DISTINCT(Area)) from TABLE
(b) SELECT SName from TABLE SHOPPE where
SHOPPE:
Name like 'A%;
(c) SELECT Id, SName from TABLE SHOPPE
37. Writea
where Area ='CP
function in Python SPush(L), where Lis a list of
into a stack
numbers. From this list,
implemented by using a list. push all numbers divisible by 5
Display the stack if it
has at least one
appropriate error message. element, otherwise display
OR 3
Complimentary Booklet
write a unction in
Python SPOPL), where L is 23
The function retums the value a stack
implemented by a list of numbers which are multple of
deleted from the stack.

SECTION-II
38. SunRise Pt. Ltd. is
setting up the network in the Ahmadabad.
There are four
departments named as MrktDept,
FunDept, LegalDept, SalesDept.

MrktDept SalesDept

Legal Dept Fun Dept

Distance between various buildings is given


as follows
MrktDept to FunDept 80 m
undept
MrktDept to LegalDept 180 m
MrktDept to SalesDept 100 m

LegelDept to SalesDept 150 m

LegalDept to FunDept 100 m

FunDept to SelesDept50m
Number of Computers in the buildings:

MrktDept 20

LegalDept 10

FunDept 08

SalesDept 42

connections between the departments and specify topology.


(a) Suggest a cable layout of
place the server with a suitable reason.
suitable building to
(b) Suggest the most
network.
of modem in the
(c) Suggest the placement
Hub/Switch in the network
of
(d) Suggest the placement
citywhich type of
stuated in various part of the
counter same
link fs sale
is planning to
()The organization
MAN will be
formed? Justify.
nework out of LAN, WAN,
24
DEEPAK CBSE Sample Paper 12th
39. Write the SQL queries for the statements (a) to (e) based on the tables MobileMaster and MobileStock. 5
TABLE MOBILEMASTER

M_Id M_Company M_Name M_Price M_Mf_Date


MBO01 Samsung Galaxy 4500 2013-02-12
MBO03 Nokia N1100 2250 2011-04-15
MB004 Micromax Unite3 4500 2016-10-17
MB005 Sony XperiaM 7500 2017-11-20
MBO06 Oppo SlefieEx 8500 2010-08-21

TABLE MOBILESTOCK

S Id M_Id M_Qty M_Supplier


S001 MBO04 450 New Vision
SO02 MBO03 250 Praveen Gallery
S003 MB001 300 Classic Mobile Store
S004 MB006 150 A-one Mobiles
SO05 MB003 150 The Mobile
S006 MB006 50 Mobile Centre

(a) To display the mobile company, mobile and


name price in descending order of their manufacturing date.
(b) To list the details of mobile whose name starts with "S".
(c) To display the mobile supplier and quantity of all mobiles except "MB003".

(d) To
display the name of mobile company having price between 3000 and 5000.
(e)To display mobile company and the corresponding supplier name.
40. A binary file "Insurance.dat" has structure [pid,pname].
(a) Write a user defined function Personlns() to input data for a record and add to
Insurance.dat file.
(b) Write a function Displaylnfo(SN) to display information regarding the person "Riya" stored in the fie
Insurance.dat.

OR
"Softw.DAT" has structure (SNAME, SPRICE). Write a
A binary file
function Softwares( ) in Python that wouia
read contents of the file "Softw.DAT and dlsplay details of
"

product whose name is 'AntiVirus'.

O00
Complimentary Booklet
- ANSWER KEY 25

PART-A
1. (a) and Logical SECTION-I
(b)>= Relational
(c) Augmented Assignement
**
(d) Arithmetic
2. (-20, 5)
3. Function: writerow()
4. Sequence Data Type: List, Tuple
5. $1.append($2)
6. fbr': 'Honda', 'mod: "Vols)
7. Length:8
8. (a) math module

(b) pickle module


9. e-mail
10. Trehan's email has been attacked
with spam. He must have checked some
promotional offers while surfing the
Internet. He should use filters in his emails to
stop receiving the unwanted mails.
11. WHERE
12. Underscore ()and percentage (%).
13. sum(column-name)
14. (b) ALTER
15. Don't give out personal information to anyone like your identity proof, bank account details and share your OTP
16. c)tuple
17. Output: o@
18. Equi join and natural join
19. Telnet
20. Primary key
21. In case of open source software, the source code is publicly available to anyone who wants it and programmers
can read or change that code if they desire whereas, in closed source software (also known as proprietary
software), the public is not given access to the source code, so they can't see or modify it in any way
SECTION-II
22. (a) Primary key: ld

(b) Degree 5

Cardinality: 5
(c) INSERT INTO TRAN(Id, Product, Qty, Price, Transaction Date) VALUES(108, 'Cover, 50, 500, 2015-04-03)
(d) DESCRIBE TRAN
(e) (i) DROP TABLE TRAN
26
DEEPAK CBSE Sample Paper
23. (a) csv 12th
(6) writer
(c) r
(d) close(0
(e) [2005,Lak Sales]
[2006,Pt Hardware']
PART-B
SECTION-I
24. (a) 58

(b) False
25. Cookies is small text
file that web servers send
to a web browser so that the web server
user's activity on a particular website.
can keep track of the
Specific cookies known as HTTP cookies are used to
users and improve
your web browsing
identify specific
experience.
OR
Firewall is hardware or software based network security
network.
system. It prevents unauthorized access to or from a

A Hardware Firewall is a
physical device similar to a server that filters traffic to
routers.
a computer, for eg. Linksys
A software firewall is installed on individual computers/servers. It intercepts every request
connecting to the computer and after this, it determines if the by the network for

26. request is valid or not, for eg. Netdefender.


(a) GSM Global System for Mobile Communication
(b) GPRS: General Packet
Radio Service
(c) Wi-Fi: Wireless Fidelity
(d) VoiP
:Voice over Internet Protocol
27. def Pattern(MyList):
for i in MyList
if i.isalpha():
print(1+'* ')
elif i.isnumeric():
print(i*2)
else
print(1)

MyList= ['RAMAN', '21 'YOGRAJ' '3', 'TARA'1


Pattern(MyList)
OR
Break statement in Python stops the execution
of the current
code picks up from and executes the next line loop in which it is used. When the loop ends, tne

statement is used to skip code WInin a


immediately following the loop that was broken. The continue
loop for certain
iterations of the loop.
Complimentary Booklet
For example 27
#Use of break and
continue statement s inside the l0op

for val in
"string" :

if val == "i":
break
elif val == t ' :
Continue
else:

print(val, end '')


In the above code, when val gets ". It exists from the loop. When val gets value 't, it moves the control back to
for to get the value of next iteration that is 'r
here.
28. letter
input( 'Enter any letter (A-Z) ) #Error 1

if letter ==
'a' or
letter 'e' or letter 'i" #Error 2
print ('a or e or i') #Error 3
else: #Error 4
print('cons')
29. (i) and () options are possible outputs
Maximum value of PICKER =3
Minimum value of PICKER = 0

30. A primary key is used to ensure data in the specific column is unique. A foreign key is a column or group of
columns in a relational database table that provides a link between data in two tables. If two table contains the
same column in such a way that in one table it is acting as primary key then in another table it is treated as

foreign key. A foreign key can contain redundant values.


31. (a) fetchmany(3)

(b) fetchone( ) function fetches next single row.


32. DML is Data Manipulation Language, eg. Create command
DDL is Data Definition Language, eg. Select command
33. Output
60 u$V$WS
SECTION-I
34. sCORES [25,36,54,86,94]
def FEnding (SCORES)

for i in SCORES:
if i%10 = 4
s S+ 1
ending with 4 are: '.s)
print('Sum of numbers
FEnding(SCORES)
28
DEEPAK CBSE Sample Paper 12th
35. def Displine():
Ad "Wonder. txt'
fob
open (Ad, 'r')
lines =

for 1 in lines:
fob.readlines ()
if 1[e] 'c'
==
or 1[0] ==
'c':
print (1, end = '')
else
pass
fob.close()
DispLine()
OR
def LettFreq():

fobj open( "Birbal.txt', "'r')


txt = fobj.read(
Count =
for ch in txt:
if ch ==
'r' or ch 'R': ==

Count= count + 1
else:
pass

print('Occurrence of letter r or R in the


text',count)
fobj.close ()
LettFreq()
36. (a) COUNT(DISTINCT(Area)) :3

(b) SName
ABC Computronics
|All Infotech Media
(c) ld SName
SO03 Tech Shoppe
37. def SPush(L)
s=[]
for x in range(®,
len (L)) :
if L[x]<5 = 0:
s.append(L[x])
if len(s) ==0:
print("Empty Stack")
else:
print(s)
OR
Complimentary Booklet
def SPOP (L):
# If stack is empty
if len(L) ==
0:

print("Underflow" )
else:
n len(L)
val=L[n-1]
print'Element deleted ' val)
L.pop(n-1)
print( Current stack status: ',L)
SECTION-III
38. (a) Star Topology

FunDept

MrktDept
SalesDept

LegalDept

As per 80 20 rule, MrktDept is the best place to house the server as it contains the maximum number of
(b)
computers.
case Internet connection is required.
(c) Each building should have modem in

(d) Each building should have hub/switch to establish LAN within the building.

(e) MAN (Metropolitan Area Network)


39. M_Name, M_Price FROM MobileMaster ORDER BYM_M_Date DESC;
(a) SELECT M_Compnay,

(b) SELECT MobileMaster WHERE M_Name LIKE "S%"


FROM
MobileStock WHERE M_ld <> "MBO03";
c) SELECT M_Supplier, M_Qty FROM
BETWEEN 3000 AND 5000;
MobileMaster WHERE M_Price
(d) SELECT M_Company FROM
from MobileMaster M, MobileStock T
(e) SELECT M.M_Company, T.M_Supplier
WHERE M.M_Id = T.M_Id
DEEPAK CBSE Sample Paper 12th

40. import pickle


def Person Ins ()
fobj open("Insurance.dat", 'ab*)
pid int(input('Enter person id = '))

pname input("Enter name of person =')


row =
[pid, pname]
pickle.dump(row, fobj)
fobj.close()

def DisplayInfo (SN):


fobj open("Insurance.dat", 'rb')
try:
while True:
row pickle.load(fobj)
print(row)
if rec[1] == SN:

print(row," Found')
except:
fobj.close()
OR

def Softwares ()
fobj =open("Softw.dat", 'rb')

try:
while True:
row pickle. load(fobj)
if row[e] = 'Antivirus' :

print(row)
except:
fobj.close()

O00

You might also like