Class Xii Computer Science Final Mock Test Paper QP
Class Xii Computer Science Final Mock Test Paper QP
General Instructions:
Q. Question
No. Marks
SECTION A
1 State True or False: 1
(a) ( 'Amrit Mahotsav', '@', '75') (b) ['Amrit', 'Mahotsav', '@', '75']
(c) ('Amrit', 'Mahotsav @ 75') (d) ('Amrit', ' ', 'Mahotsav @ 75')
5 In a relational model, _______ is the number of columns. 1
Page No. 1
(a) Attribute
(b) Degree
(c) Relation
(d) Tuple
6 Two doctors seating in a room and sharing some data between their mobile 1
phone. Identify the type of network formed by their devices.
a) LAN b) MAN c) PAN d) WAN
7 Given the following dictionary 1
Day={1:"Monday", 2: "Tuesday", 3: "Wednesday"}
Which statement will return "Tuesday".
(a) Day.pop()
(b) Day.pop(2)
(c) Day.pop(1)
(d) Day.pop("Tuesday")
8 What will the following expression be evaluated to in Python ? 1
2+3/3**1**2*5+10
(a) 6.5
(b) 17.0
(c) 16.0
(d) 17
9 Which of the following statement(s) would give an error after executing the 1
following code?
Options :
a) Pencil:Book
b) Pencil:Book
Eraser:Bag
c) Pen:Book
Bag:Book
d) Bag:Eraser
Page No. 2
11 Fill in the blank: 1
______is a communication methodology designed to deliver both voice
and multimedia communications over Internet protocol.
(a) VoIP (b) SMTP (c) PPP (d)HTTP
12 Consider the code given below: 1
c=1
def add():
_________ # missing statement
c=c+4
print(c)
add()
Which of the following statements should be given in the blank for #Missing
Statement, if the output produced is 5 ?
Options:
a. global c
b. global c= 5
c. global 5
d. c= 5
13 __________ function returns a list containing each line in the file as a list item. 1
a. tell()
b. read()
c. readline()
d. readlines()
14 1
Which of the following statements is FALSE about keys in a relational database?
a. Any candidate key is eligible to become a primary key.
b. A primary key uniquely identifies the tuples in a relation.
c. A candidate key that is not a primary key is a foreign key.
d. A foreign key is an attribute whose value is derived from the primary key of
another relation.
15 Fill in the blank : 1
_______ is used for point-to-point communication or unicast communication such
as radar and satellite.
a. Micro waves
b. Infrared waves
c. Radio waves
d. Bluetooth
16 State whether the following statement is True or False: 1
An exception may be raised even if the program is syntactically correct.
Q17 and 18 are ASSERTION AND REASONING 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
17 Assertion (A): CSV (Comma Separated Values) is a file format for data storage 1
which looks like a text file.
Reason (R): The information is organized with one record on each line and each
Page No. 3
field is separated by comma.
18 Assertion (A) : readlines() reads all the lines from a text file and returns the lines 1
along with newline as a list of strings.
Reason (R) : readline() can read the entire text file line by line without using any
looping statements.
SECTION B
19 Differentiate between Bus Topology and Star Topology. Also, write one advantage 2
of each of them.
OR
OR
Write a function, lenWords(STRING), that takes a string as an argument and
returns a tuple containing length of each word of a string.
For example, if the string is "Come let us have some fun", the tuple will have (4, 3,
2, 4, 4, 3)
Page No. 4
23 Write the Python statement for each of the following tasks using BUILT-IN 2
functions/methods only:
SECTION C
26 Write the output of the code given below: 3
a=30
def call(x):
global a
if a%2==0:
x+=a
else:
x - =a
return x
x=20
print(call(35),end=”#”)
print(call(40),end=”@”)
27 Write the output of the SQL queries (a) to (d) based on the table TRAVEL 3
given below :
Page No. 5
(i) SELECT COUNT(DISTINCT START) FROM TRAVEL;
(ii) SELECT T_ID, FARE FROM TRAVEL
WHERE T_DATE LIKE '2021%' ;
(iii) SELECT T_ID, T_DATE FROM TRAVEL WHERE END = 'CHENNAI'
ORDER BY FARE ;
28 Write a function count_Dwords () in Python to count the words ending with a digit 3
in a text file "details.txt".
Example:
If the file content is as follows:
On seat2 VIP1 will sit and
On seat1 VVIP2 will be sitting
Output will be:
Number of words ending with a digit are 4
OR
Write the definition of a Python function named LongLines ( ) which reads the
contents of a text file named 'lines.txt’ and displays those lines from the file which
have at least 10 words in it. For example, if the content of 'lines.txt' is as follows:
Once upon a time, there was a woodcutter
He lived in a little house in a beautiful, green wood.
One day, he was merrily chopping some wood.
He saw a little girl skipping through the woods, whistling happily.
The girl was followed by a big gray wolf.
Based on the given table, write SQL queries for the following:
(i) Increase the amount by 10% of all loan_no.
(ii) Display loan_no and interest (12 % of amount) of all records. The column
heading ‘Monthly interest’ should also be displayed.
(iii) Delete the records of loan_no who have amount less than 4000.
30 A list contains following record of course details for a University: 3
[Course_name, Fees, Duration]
Write the following user defined functions to perform given operations on the stack
named ‘Univ’ :
(i) Push_element() - To push an object containing the
Course_name, Fees and Duration of a course, which has fees
greater than 100000 to the stack.
(ii) Pop_element() - To pop the object from the stack and display it.
Also, display “Underflow” when there is no element in the stack.
For example :
If the lists of courses details are :
[‘MCA’, 200000,3]
[‘MBA’, 500000,2]
[‘BA’, 100000, 3]
Page No. 6
The stack should contain :
[‘MBA’, 500000,2]
[‘MCA’, 200000,3]
SECTION D
31 1X4=4
Consider the tables COMPUTER and SALES given below:
OR
i. Give any one point of difference between a binary file and a csv file.
ii. Write a Program in Python that defines and calls the following user defined
functions:
(i) add() – To accept and add data of an employee to a CSV file ‘furdata.csv’.
Each record consists of a list with field elements as fid, fname and fprice to
store furniture id, furniture name and furniture price respectively.
(ii) search()- To display the records of the furniture whose price is more than
10000.
Page No. 7
SECTION E
33 ABC Consultants are setting up a secure network for their office campus at Noida 1x5=5
for their day-to-day office and web-based activities. They are planning to have
connectivity between three buildings and the head office situated in Bengaluru. As a
network consultant, give solutions to the questions (i) to (v), after going through the
building locations and other details which are given below :
(i) Suggest the most suitable place to install the server for this
organization. Also, give reason to justify your suggested location.
(ii) Suggest the cable layout of connections between the buildings
inside the campus.
(iii) Suggest the placement of the following devices with justification :
i. Switch
ii. Repeater
(iv) The organization is planning to provide a high-speed link with the head office
situated in Bengaluru, using a wired connection. Suggest a suitable wired medium
for the same.
(v) The System Administrator does remote login to any PC, if any requirement
arises. Name the protocol, which is used for the same.
34 1+4=5
(i) Differentiate between r+ and w+ file modes in Python.
(ii) Consider a file, SPORT.DAT, containing records of the following structure:
[MNO,MNAME, MTYPE]
Where
MNO – Movie Number
MNAME – Movie Name
MTYPE is Movie Type
Write a user defined function, findType(mtype), that accepts mtype as parameter and
displays all the records from the binary file CINEMA.DAT, that have the value of Movie
Type as mtype.
35 (i) Give one difference between alternate key and candidate key. 1+4=5
(ii) Kabir wants to write a program in Python to insert the following record in the table
named Student in MYSQL database, SAMPLE2023:
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 - tiger
Host - localhost
The values of fields rno, name, DOB and fee has to be accepted from the user. Help Kabir
to write the program in Python.
OR
i. Give one difference between primary key and foreign key.
ii. The code given below inserts the following record in the table Student:
RollNo – integer
Name – string
Clas – integer
Marks – integer
Note the following to establish connectivity between Python and MYSQL:
Username is root
Password is tiger
The table exists in a MYSQL database named school.
The details (RollNo, Name, Clas and Marks) are to be accepted from the user.
Write the following missing statements to complete the code:
Statement 1 – to access MySQL database
Statement 2 – to form the cursor object
Statement 3 – to execute the command that inserts the record in the table Student.
Statement 4- to add the record permanently in the database
Page No. 10