0% found this document useful (0 votes)
32 views7 pages

Xii Comp Sci MQP 15

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views7 pages

Xii Comp Sci MQP 15

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

KENDRIYA VIDYALAYA SANGATHAN HYDERABAD REGION

CLASS: XII SESSION: 2024-25


MODEL QUESTION PAPER SET 2
COMPUTER SCIENCE (083)

Time allowed: 3 Hours M.M: 70

General Instructions:
● This question paper contains 37 questions.
● All questions are compulsory. However, internal choices have been provided in some
questions. Attempt only one of the choices in such questions
● The paper is divided into 5 Sections- A, B, C, D and E.
● Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
● Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
● Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
● Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
● Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
● All programming questions are to be answered using Python Language only.
● In case of MCQ, text of the correct answer should also be written

Q.No Mark
. SECTION-A (21 x 1 = 21 Marks) s
1 Find the invalid identifier [1]
(A) Name (B) break (C) marks 12 (D) section
2 Evaluate the expression given below A=16 and B=15 A%B//A [1]
(A) 0.0 (B) 0 (C) 1.0 (D) 1
3 AL is defined as follows : AL=[1,2,3,4,5] Which of the following statement removes the [1]
middle element from it so that the list AL equals to [1,2,4,5]

(A) del AL[2] (B) AL[2:3]=[ ] (C) AL[2:2]=[ ] (D) AL.remove(3)


4 Suppose T is declared as T=(10,12,43,39) which of the following is incorrect? [1]
(A) print(T[1]) (B) print(max(T) (C) T[2]=-29 (D) print(len(T))
5 What is the output of the code >>>int("3+"4") [1]
(A) "7" (B) "34" (C) 24 (D) 34
6 Which of the following is the correct form of declaration of a dictionary? [1]
(A) Day=[1:'Mon', 2:'Tue', 3: 'Wed'] (C) Day=[1;'Mon', 2;'Tue', 3; 'Wed']
(B) Day={1:'Mon', 2:'Tue', 3: 'Wed'} (D) Day={1;'Mon', ;'Tue', 3;'Wed'}
7 Which of the given argument types can be skipped from a function call? [1]
(C) named
(A) positional (B) keyword arguments (D) default arguments
8 Which of the function call will cause Error while invoking the below function definitions [1]
def test(a,b,c,d)
(B) (D)
(A) test(1,2,3,4) test(a=1,b=2,c=3,4) (C) test(a =1,2,3,4) test(a=1,b=2,c=3,d=4)
9 Which of the following is not a correct Python statement to open a text file "Notes.txt" to [1]
write content into it?
(A) F=open("Notes.txt", 'w+') (C) F=open("Notes.txt", 'w')
(B) F=open("Notes.txt", 'A') (D) F=open("Notes.txt", 'a')
10 A security mechanism that can be created in hardware and software both to prevent the [1]
unauthorised access to and from the network is called___________________
(A) Anti-virus (B) Network security (C) Authentication (D) Firewall
11 IMAP stands for [1]
(A) Internet Message Access Protocol (C) Internetwork Mapping Access Protocol
(B) Internet Mapping Add Protocol (D) Internetwork Message Added Protocol
12 Which device is more intelligent while sending data packets [1]
(A) Router (B) Switch (C) Modem (D) None of them
13 Which command is used in removing the table and all its data from the database [1]
(A) DROP (B) DELETE (C) DESCRIBE (D) ALTER
14 Which of the following command change the structure of the table/characteristics? [1]
(A) ALTER (C) CHANGE
TABLE (B) MODIFY TABLE TABLE (D) All of the above
15 Which of the following is not a legal constraint for CREATE TABLE command [1]
(A) Primary key (B) Foreign key (C) Unique (D) Distinct
16 Which is a join condition contains equality operator? [1]
(A) Equi joins (B) Cartesian product (C) Both (A) & (B) (D) None of them
17 State whether True or False ? [1]
The cursor.rowcount gives the count of the records in the resultset.
18 ___________command makes the changes reflect in the database permanently [1]
(A) done()
(B) reflect()
(C) commit()
(D) final()
19 Which method is used to convert the first character of a string to uppercase in Python? [1]
(A) upper()
(B) capitalize()
(C) title()
(D) first_upper()
Q20 and Q21 are Assertion(A) and Reason(R) based questions. Mark the correct choice
as: (A) Both A and R are true and R is the correct explanation for A
(B) Both A and R are true and R is not the correct explanation for A
(C) A is True but R is False
(D) A is False but R is True

20 Assertion (A):Modifying a string creates another string internally but modifying a list cannot [1]
create a list internally
Reason(R): Stings are immutable types whereas Lists are mutable types in Python.

Assertion (A): Exception handling code is clear and block based in Python. [1]
21 Reasoning (R): The code where unexpected runtime exception may occur is separate from
the code where the action takes place when an exception occurs.
SECTION-B ( 7 x 2=14 Marks)
22 Predict the output of the following : [2]
fruit={}
f1=['Apple', 'Banana', 'apple', 'Banana']
for index in f1:
if index in fruit:
fruit[index]+=1
else:
fruit[index]=1
print(fruit)
print(len(fruit))
23 Write the difference between actual parameter and formal parameter with example? [2]

24 Write the Python statement for each of the following tasks using BUILT-IN functions /
methods only:
I)
A. To update dictionary d1 with dictionary d2
or
B. Write the code to remove the fifth element from the list L?
II)
(A ) To add an element 10 in 2nd position into the list age.
or
( B) To replace the letter m with ‘@’ in a string “ Computer Science” holding the variable
name as subject?
25 Consider the following code : [2]
import random
AR=[20, 30,40, 50,60,70]
Lower=random.randint(1,3)
Upper=random.randint(2,4)
for K in range(Lower, Upper+1):
print(AR[K],end=’#’)
What possible output(S) are expected to be displayed on the screen at the time of
execution of the program from the following code?
(A) 10#40#70# (B) 30#40#50# (C) 50#60#70# (D) 40#50#60#
26 Rewrite the following code in Python after removing all syntax error(s). Underline each [2]
correction done in the code.
Value=39
for VAL in range(0,Value)
If val%4==0:
print(VAL*4)
Elseif val%5==0:
print(VAL+3)
Else:
print(VAL+10)
27 (i) (A) A table1 has 5 records and 4 columns another table2 has 6 rows and 3 columns .If 2 [2]
records are added in table2 and 2 columns are removed from table 1 .After cartesan product
of table1 and table2 what is its degree and cardinality?
Or
(B) Which declaration of datatype helps to enter same number of characters everytime ?
(ii ) (A) Which command helps to increase the cardinality of a table?
Or

(B) Which category of commands help to change degree of a table ?


28 Write the full forms of i. SMTP ii. NFS ? What is the name given to the complete path of a [2]
webpage?
(OR)
Differentiate between Switch and Hub
SECTION C (3 X 3= 9 MARKS)
29 Write a function COUNT_AND () in Python to read the text file “STORY.TXT” and count 3
the number of times “AND” occurs in the file. (include AND/and/And in the counting)
OR
Write a function DISPLAYWORDS( ) in python to display the count of words starting with
“t” or “T” in a text file ‘STORY.TXT’
30 Two list Lname and Lage contains names of persons and age of persons respectively. A list 3
named Lnameage is empty. Write functions as details given below
(i) Push_na() :- it will push the tuple containing pair of name and age from Lname and Lage
whose age is above 50
(ii) Pop_na() :- it will remove the last pair of name and age and also print name and age of
removed person. It should also print “underflow” if there is nothing to remove.
For example, the two lists have following data
Lname=[‘narender’, ‘jaya’, ‘raju’, ‘ramesh’, ‘amit’, ‘Piyush’]
Lage=[45,23,59,34,51,43]
After Push_na() the contains of Lnameage stack is
[(‘raju’,59),(‘amit’,51)]
The output of first execution of pop_na() is
The name removed is amit
The age of person is 51
OR

(i) Push (st, expression), where expression is a string containing a valid arithmetic expression
with +, -, *, and / operators, and st is a list representing a stack. The function should push all
the operators appearing in this expression into the stack st.
(ii) Pop(st) to pop all the elements from the stack st and display them. It should also display
the message 'Stack Empty' when the stack becomes empty.
iii) Main program to accept the expression from the user and add only arithmetic expression
using function call statements accordingly.
31 x = 25 [3]
def modify(s, c=2):
global x
for a in s:
if a in 'QWEiop':
x //= 5
print(a.upper(),'@',c*x)
else:
x += 5
print(a.lower(),'#',c+x)
string = 'We'
modify(string,10)
print(x, '$', string)

OR
Predict the output of the following code:
L=[2,4,6,8,10]
for i in L:
for j in range(I,len(L)+1):
print(j,’#’,end=””)
print()
SECTION – D (4 X 4 =16 MARKS)
32 Write the output of the queries (i) to (iv) based on the table PRODUCTS given below: [4]
Table: PRODUCTS
CODE ITEM QTY PRIC TDATE
E
1001 Plastic Folder 14'' 100 3400 2014-12-14
1004 Pen Stand Standard 200 4500 NULL
1005 Stapler Mini 250 1200 2015-02-28
1006 Punching Machine NULL 1400 2015-03-12
Small
1009 Stapler Big 100 1500 NULL
i) SELECT COUNT(TDATE) FROM PRODUCTS;
ii) SELECT MAX(TDATE) FROM PRODUCTS WHERE PRICE BETWEEN 1000
AND 1400;
iii) SELECT ITEM, QTY*PRICE AS “TOTAL” FROM PRODUCTS WHERE QTY >
200 AND ITEM LIKE ‘%tap%’;
iv) SELECT ITEM, TDATE FROM PRODUCTS WHERE QTY IS NULL AND
PRICE =1400;

or

Write the queries (i) to (iv) based on the table PRODUCTS given below:
i) Display the complete details of products whose Tdate is before the year 2015.
ii) Add a column UNIT PRICE using integer which include two digits and restrict
the entry of null values.
iii) To show the maximum and minimum price of items.
iv) Write query to increase the price by 10% whose price is more than 1200.
33 Write a Program in Python that defines and calls the following user defined functions
(i) InsertRow() – To accept and insert data of an student to a CSV file ‘class.csv’.
Each record consists of a list with field elements as rollno, name and marks to
store roll number, student’s name and marks respectively.
(ii) COUNTD() – To count and return the number of students who scored marks
greater than 75 in the CSV file named ‘class.csv’.
34 Consider the tables STORE and SUPPLIERS given below:
Table : Store
ITEM NO ITEM SCODE QTY RATE LASTBUY
2005 Sharpner Classic 23 60 8 2009-11-31
2003 Ball pen 22 50 25 2010-01-31
2002 Gel pen 21 150 12 2001-11-23
premium
2004 Gel pen classic 22 250 20 2009-01-11
2006 Eraser small 21 220 6 2009-05-12
2008 Eraser big 21 110 8 2009-06-14
2005 Ball pen 0.5 22 180 18 2009-03-25

Table : Supplier
SCODE SNAME
21 Premium Stationary
22 Soft Plastics
23 Tetra Supply
i) To display ItemNo, Item Name and Sname from the tables with their
corresponding matching Scode.
ii) Display the structure of the table store.
iii) Display the average rate of Premium Stationary and Tetra Supply.
iv) A )Display the item, qty, and rate of products in descending order of rates
Or
B ) Display the complete report of store whose item name has p letter in between.
35 Rojalina Gamango has created a table named Student in MYSQL database, SCHOOL: 4
• rno (Roll number)- integer
• name (Name) - string
• DOB (Date of birth) – Date
• Fee – float
Note the following to establish connectivity between Python and MySQL:
• Username - root
• Password – root
• Host – localhost
Rojalina Gamango now wants to display the records of students whose fee is more than
3500.
SECTION - E ( 2 X 5 = 10 MARKS)
36 A binary file data.dat needs to be created with following data written it in the form of 5
Dictionaries.
EI ENAME SALARY
D
101 KARTHIK 55000
102 SANIA 65000
103 SOMESH 52000
Write the following functions in python accommodate the data and manipulate it.
a) A function insert() that creates the data.dat file in your system and writes the three
dictionaries.
b) A function() read() that reads the data from the binary file and displays the dictionaries
whose SALARY is greater than 50000.
c ) A function to delete those records whose employee id is more than 102.
37 NMS Training Institute is planning to set up its Centre in Bhubaneswar with four specialized 5
blocks for Medicine, Management, Law courses along with an Admission block in separate
buildings. The physical distances between these blocks and the number of computers to be
installed in these blocks are given below. You as a network expert have to answer the queries
raised by their board of directors as given in (i) to (iv). Shortest distances between various
locations in meters:
Admin Block to Management Block 50 m
Admin Block to Medicine Block 30 m
Admin Block to Law Block 65 m
Management Block to Medicine Block 40 m
Management Block to Law Block 125 m
Law Block to Medicine Block 35 m

Number of Computers installed at various locations are as follows:


Admin Block 250
Management Block 100
Medicine Block 45
Law Block 95

(i). Suggest the most suitable location to install the main server of this institution to get
efficient connectivity.
(ii). Suggest the layout and also draw the best cable layout for effective network
connectivity of the blocks having server with all the other blocks.
(iii). Suggest the device to be installed in each of these buildings for connecting computers
installed within the building.
(iv) Suggest the most suitable wired medium for efficiently connecting each computer
installed in every building out of the following network cables:
• Coaxial Cable
• Ethernet Cable
• Single Pair
• Telephone Cable.
(v) A) Suggest a device/software to be installed to take care of data security.
Or
B ) Suggest the type of network? (PAN,LAN,MAN,WAN)

You might also like