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

Practice QP CS Class XII Set-II

This document provides instructions and questions for a Computer Science practice test for Class XII. It has two parts - Part A and Part B. Part A has two sections - Section I with short answer questions and Section II with two case study questions containing subparts. Part B has three sections - Section I with short answer questions, Section II with long answer questions, and Section III with very long answer questions. All programming questions must be answered in Python. It provides the structure, instructions, and various questions to be answered for the practice test.

Uploaded by

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

Practice QP CS Class XII Set-II

This document provides instructions and questions for a Computer Science practice test for Class XII. It has two parts - Part A and Part B. Part A has two sections - Section I with short answer questions and Section II with two case study questions containing subparts. Part B has three sections - Section I with short answer questions, Section II with long answer questions, and Section III with very long answer questions. All programming questions must be answered in Python. It provides the structure, instructions, and various questions to be answered for the practice test.

Uploaded by

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

Class: XII Session: 2020-21

Computer Science (083)


Practice Test II(Theory)
Maximum Marks: 70 Time Allowed: 3hours

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 2sections:
a. Section–I is short answer questions, to be answered in one word or one line.
b. Section–IIhastwocasestudiesquestions.Eachcasestudyhas4case-basedsubparts.An
examinee is to attempt any 4 out of the 5 subparts.
4. Part - B is Descriptive Paper.
5. Part- B has three sections
a. Section-I is short answer questions of 2 marks each in which two question have
internal options.
b. Section-II is long answer questions of 3 marks each in which two questions have
internal options.
c. Section-III 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

Q. Part- A Mark
No. s
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 Identify the valid literals from the following:
i)"100" ii) _init iii) 3, iv) 100days 1
2 Given the dictionary d={"A":100,"B":200,"A":300} What will be the output
of the statement print(d)? 1
3 The python function that places the read pointer to a given location in a
binary file is called……………………… 1
4 Which one of the following is not a valid operator in python?
I) # ii) ** iii) and iv) is 1
5 Which of the following options uses the correct way to copy one list into another:
i) newlist =copy(oldlist) ii) newlist =oldlist.copy() 1
iii) newlist =list(oldlist) iv) newlist.copy(oldlist)
6 For the given dictionary d={"Product":"Pencil","stock":100,"Price":30} the correct
option for the value of x:
x= d.popitem() 1
print(x)
(i) ["Price",30] (ii) 30 (iii) "Price” (iv) ("Price",30)
7 For the given tuple x =(10,20,30,40), what will be the value of x[::-2] 1
8 Which of the following function is not a part of string library?
i) Partition() ii) isupper() 1
iii) update() iv) endswith()
9 Name one of the Mobile Communication protocols. 1
10 Your friend has used a poetry written by you and posted online claiming her own.
1
Which Act violation has been committed by her?

1 of 7
11 In SQL which clause is used to provide condition in a GROUP BY clause? 1
12 How many Foreign Keys a relation can have in MySQL database Table?
i) One or more ii) Zero or more 1
iii) Only one iv) None
13 Which command in SQL is used to display structure of a table? 1
14 Re-write the following DML query after removing the error:
UPDATE student MODIFY age = age+1 1
WHERE class=12;
15 I help transmit packets to their destinations by charting a path through the sea of
1
interconnected networking devices using different network topologies. Who am I?
16 State the following python expression as True or False
{"key1":1, "key2":2}=={"key2":2, "key1":1} 1
17 What will be the output od the following python program?
st = "PYTHON"
1
l = st.split("T")
print(l)
18 “PRIMARY key column can have NULL values” . State the given statement as
1
True or False.
19 Expand the term GPRS. 1
20 Which of the Joins exclude one of the matching columns from the SQL query
1
based on related tables?
21 What does the b stand for in the data transfer rates like Kbps, Mbps, etc?
1
Section-II
Both the Case-study based questions are compulsory. Attempt any 4 sub parts
from each question. Each question carries 1 mark
22 Anu has created the following relations in database Travels by providing Primary
Key – Foreign Key relationship.
Table: booking

Table: Flights

a) Which attribute is the Foreign Key in the given tables? 1


b) What is the degree of booking table and cardinality of Flights table? 1
c) Write a SQL query to delete the row from booking whose pname is “KAY”. 1
d) Anu wants to display the unique destinations from the booking table. Which
keyword need to be used by her in SELECT query:
i) UNIQUE ii)DISTINCT iii) HAVING iv)SET 1
e) Write a command to display the cardinality of the booking table?
1

2 of 7
1
23 Shyam of class 12 is writing a program to create a CSVfile “country.csv”which
will contain Country, Capital and Game for that Country. He has written the
following code. As a programmer, help him to successfully execute the given task.

headings = ['Country','Capital','Game']
data = [['India', 'Delhi','Hockey'],
['USA','Washington DC','Ice Hockey'],
['Newzeland','Wellington','Rugby']]
f = open('country.csv','w', newline='')
csvwriter = csv.writer(f)
____________________________ # Statement1
____________________________ # Statement2
f.close()

f =open('country.csv','r')
csvreader =csv.reader(f)
data =[]
for x in csvreader:
# Statement 3
print(data[1])
1
a) His code is not executing. Write the statement that he has missed. 1
b) Fill in the blanks so that the header row can be written using statement1 1
c) Fill in the blanks so that all the data is written using statement 2. 1
d) Fill in the blanks so that elements are added to the empty list data in
statement 3. 1
e) What will be the output of the print(data[1]) 1
Part B
Section - 1
24 What will be the output of the following python expression:?
a) 5 + 2*2**3//2-10 2
b) True or False and not 10 >20
25 Write two points to differentiate between MAC address and IP address.
OR 2
Write two points to differentiate between HTML and XML.
26 Expand the following terms in Computer Networking:
2
I) WLL ii) PPP iii) URL iv) PAN
27 Explain the use of default parameters in a python user defined function using an
example.
Or 2
Python functions can return more than one objects. Explain the same using an
example.
28 Rewrite the following code in Python after removing all syntax error(s). Underline
each correction done in the code.

sum = 0
for x in [10,20,30,40] 2
if x % 3==0 OR x % 4==0:
sum = sum+ x
elselif x % 6==0:
sum = sum - x

3 of 7
else:
None
print(sum)
29 What possible outputs(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 Lower and Upper.
import random
name = ['BOB', 'SID', 'KIM', 'JIM', 'MIK']
low = random.randint(0,2)
high = random.randint(2,4) 2
for x in range(high, low-1, -1):
print(name[x], end='@')

i) BOB@SID@KIM@
ii) JIM@KIM@SID@BOB@
iii) MIK@KIM@SID@
iv) KIM@SID@
30 Write two differences between a Primary Key and a Unique Key. 2
31 Observe the following python code and answer the questions:
import mysql.connector as c
con = c.connect(host="localhost", user="root", passwd="", database="test")

mycursor= #Statement 1

mycursor.execute(" CREATE TABLE studentinfo (name VARCHAR (30), age


INT(3)")
2
sql = """INSERT INTO studentinfo( name, age) VALUES ('Ashok',17) """
_____________________ Statement 2

con.commit()

i) Write the python statement to establish the database cursor as


statement1.
ii) Write the python statement to insert the row into the table as
Statement 2 by using the string ‘sql’ given above.
32 What is the difference between count(*) and count(columnname) in SQL aggregate
function?Give suitable examples to support your answer. 2
33 Find and write the output of the following Python code:
def changer(str, s):
nwstr=""
for x in str:
if x.isdigit(): nwstr=nwstr + s
elif x.isalpha():
2
if x.isupper():
nwstr=nwstr+x.lower()
else:
nwstr=nwstr+x.upper()
else:
nwstr=nwstr+"*"

4 of 7
return nwstr
print(changer('Al@miGhTy2','x'))
Section - II
34 Write a python method countmax() that accepts a list as an argument and return the
count of the element that has occurred maximum number of times.
3
Eg: for the list num =[1,2,3,1,1,2,2,3,3,3,4] the call value for
print(countmax(num)) should be 4.
35 Write a python function printed() that prints all the words ending with ‘ed’ from a
pre-written text file “data.txt:.
Eg: For the data file containing the following text:
“My schooling days ended long back. I supported my family there after.”
The output should be:
ended supported

OR 3
Write a python function print caps() that prints all the upper-case alphabets from a
pre-written text file “alpha.txt.”
Eg: for the data file containing the following text: “India is My Country”
The output should be:
I
M
C
36 Write the outputs of the SQL queries (I) to (iii) based on the relations Emp and
dept given below:
Table: Emp

3
Table:Dept

i) SELECT dno, MAX(salary) FROM emp GROUP BY dno;


ii) SELECT COUNT(DISTINCT gender) from emp;
iii) SELECT ename,dname,salary FROM emp,dept WHERE
emp.dno = dept.deptno AND location='B1';
37 Write a python function push(stack,lst), that accepts a stack and a list of names. It
pushes into the stack names from the list(lst) that have lengths of exactly three
characters. The function also prints the stack.
3
OR

5 of 7
Write a function pop(stack) that pops out the elements of the stack implemented
using a list of numbers. The function should display a warning message if there is
an underflow in the stack.
Section-III
38 Expertia Professional Global (EPG) is an online corporate training provider
company for IT related courses. The company is setting up their new campus in
Mumbai. You as a network expert must study the physical locations of various
buildings and the number of computers to be installed. In the planning phase, provide
the best possible answers for the queries (i) to (v) raised by them.

Centre to Centre distances between various blocks/centre is as follows:

5
Number of computers in each of the blocks/Centre is as follows:

a) Suggest the most suitable place (i.e., Block/Centre) to install the server of this
University with a suitable reason.

b) Suggest an ideal layout for connecting these blocks/centres for a wired


connectivity.

c) Suggest the placement of Switches and Modem in the blocks

d) Suggest the placement of a Repeater in the network with justification.

e) The company wants to provide a remote research institute 5km from the main
campus. Which type of communication link will provide the fastest link from main
campus to the remote campus.

6 of 7
39 Write SQL queries based on the relations stock and dealers.

i) To display details of all items in the stock table in descending order of Stkdate.
ii) To display the details of those items whose Dcode (Dealer Code) is 102
and Qty (Quantity) is more than 50 from the table stock.
iii) To display the itname, Dname and unitpr for all the stocks whose quantity is
more than 100.
iv) To display the stock details in the descending order of unitpr.
v) To display the itname, dcode and qty for all the stocks whose qty is in the range
50 to 100 (both inclusive)

40 Write a program and incorporate the following modules using python methods:
i) A python method createfile() that creates a binary file “staff.dat” and
adds three records in the file. Each record comprises of data (Staffid,
name, designation, salary)
ii) A python method display() that reads the binary file “staff.dat” and prints the
records whose salary is greater than 5000

OR 5

Write a python program and incorporate the following modules:


i) A python method addrec() that creates the binary file zoo.dat and adds three
records in the file. Each record comprises of the data (animal, family, country, total)
ii) A python method countthem() that counts the total number of animals in the zoo
from the binary file and return the same.

7 of 7

You might also like