0% found this document useful (0 votes)
132 views12 pages

qp_csxii_pb1_set2

Qp of XII CS

Uploaded by

RamanKaur
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)
132 views12 pages

qp_csxii_pb1_set2

Qp of XII CS

Uploaded by

RamanKaur
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/ 12

केन्द्र�य �वद्यालय संगठन

आगरा संभाग

प्रथम प्री बोडर् पर��ा-2024-25

KENDRIYA VIDYALAYA SANGATHAN


AGRA REGION
First Pre Board Examination-2024-25

क�ा XII (COMP SC)

Max. Time –3 hours Max. marks – 70

अ�धकतम समय -3 घंटे अ�धकतम अंक – 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./ Part-A Marks
प्रश्न भाग- अ अंक
संख्या
1 State True or False: 1
None is same as 0 or Empty String

2 Write the output:- 1


myTuple =("John", "Peter", "Vicky")
x = "#".join(myTuple)
Page 1 of 12
print(x)
(a) #John#Peter#Vicky
(b) John#Peter#Vicky
(c) John#Peter#Vicky#
(d)#John#Peter#Vicky#
3 Which of the following expressions evaluates to TRUE. 1
(a) not(True) or not (False))
(b) print(True and False)
(c) print(not(False and True))
(d) print(not (True) and False)
4 1
Select the correct output of the code:
s = "Question paper 2024-25"
s= s.split('2')
print(s)
(a) ['Question paper ', '0', '4', '-', '5']
(b) ('Question paper ', '0', '', '-', '')
(c) ['Question paper ', '0', '4-', '5']
(d) ('Question paper ', '0', '4', '', '-', '5')
5 What will be the output of the following code snippet? 1
message= "Tea City"
print(message[-1::-1])
6 What will be the output of the following code? 1
tuple1 = (1, 2, 4, 3)
tuple2 = (1, 2, 3, 4)
print(tuple1 < tuple2)
(A) True
(B) False
(C)tuple1
(D)Error
7 If one_dict is a dictionary as defined below, then which of the following 1
statements will raise an exception
one_dict = {'shoes': 1000, 'bag': 1200, 'specs': 500}
Page 2 of 12
(a) one_dict.get('specs')
(b) print(one_dict['shooes'])
(c ) k=one_dict.keys()
(d ) print(str(one_dict))
8 What does the list.pop(a) method do in Python? 1
(A) Deletes the element at index a from the list
(B) Deletes the first occurrence of value a from the list
(C) Deletes all occurrences of value a from the list
(D) Deletes the last occurrence of value a from the list
9 If a table which has one primary key and two unique constraints. How 1
many Primary keys will this table have?
(A) 1 (B) 2 (C) 3 (D) 4
10 Consider the Python statement: 1
f.seek(10, 1)
Choose the correct statement from the following:
(a) file pointer will move 10 byte in forward direction from beginning of the
file
(b) file pointer will move 10 byte in forward direction from end of the file
(c) file pointer will move 10 byte in forward direction from current location
(d) file pointer will move 10 byte in backward direction from current
location
11 In a try...expect block, there is a certain block that if specified, will be 1
executed regardless if the try block raises an error or not. What is the
name of this block? (a) finally (b) last (c) always
12 What will be the output of the following code? 1
value = 10
def show(n):
global value
value=25
if value%2==0:
value = value + n
else:

Page 3 of 12
value = value - n
print(value,end='#')
show(20)
print(value,end='%')
(A) 12%15#
(B) 10#5%
(C) 12#15%
(D) 12%15#
13 Which SQL command can change the data type of already present 1
attribute of an existing relation?
14 What will be the output of the query? 1
SELECT AVG(SALARY) FROM EMPLOYEE WHERE CITY LIKE ‘%R’;
(A) Average of salary for cities whose names start with 'R'
(B) Average of salary for cities whose names end with 'R'
(C) Salary for cities whose names end with 'R'
(D) Salary for cities whose names starts with ‘R’
15 To store the grade of students, which of the following data type will be 1
used?
(a) Char (b)Int (c )Date (d) float
16 The following command 1
Select count(*) from employee;
Will show (a) degree (b) cardinality (c) domain
17 Suggest a protocol that is used to transmit E-mail over internet.
(A) HTTP (B) FTP (C) VoIP (D)SMTP
18 Which network device is used to connect two networks that use same 1
protocols?
(A) Modem (B) Gateway (C)Switch (D)Bridge
19 Which switching technique follows the store and forward mechanism? 1
(a) Circuit switching (b) message switching
(c) packet switching (d) All of these
Q20 and Q21 are Assertion(A) and Reason(R) based questions. Mark the
correct choice as:

Page 4 of 12
(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): A variable declared as global inside a function is visible 1
with changes made to it outside the function.
Reasoning (R): All variables declared outside are not visible inside a
function till they are redeclared with global keyword
21 Assertion (A): Aggregate functions operate on groups of rows and return 1
a single result for each group.
Reasoning (R): It can be used with WHERE and HAVING clauses only.
Ques. PART B Marks
No.
22 How is a mutable object different from an immutable object in Python? 2
Identify one mutable object and one immutable object from the following:
{21:12,12:21}, (21,12), [12,21], ‘1231’
23 Give two examples of each of the following: 2
(I) Logical operators (II) Relational operator
24 Given is a Python List declaration: 2
lst1= [39, 45, 23, 15, 25, 60]
(Answer using built in functions only)
(a) Insert value 90 at index 3
(b) Display elements of list in reverse
OR
(a) Add another list [2,3,4] at end of lst1
(b) Find sum of elements of list
25 What possible output(s) are expected to be displayed on screen at the 2
time of execution of the program from the following code? Find
maximum and minimum value of begin.
import random
points=[30,50,20,40,45]
begin=random.randint(1,3)

Page 5 of 12
last=random.randint(2,4)
for c in range(begin,last+1):
print(points[c],"#")
(a) 20#50#30# (b) 20#40#45
(c) 50#20#40# (d) both (b) and (c)
26 There are syntax and logical errors in the code. Rewrite it after removing 2
all errors. Underline all the corrections made.
def find_sum(tup1,tup2)
newtup=tup1+tup2
return newtup

result= find_sumI((1, 2, 3, 4)+ (9))


print("sum of newly formed tuple: ", len(result))
27 (I) 2
A) What constraint should be applied on a table column so that different
values are allowed in that column, but NULL is not allowed.
OR
B) What constraint should be applied on a table column so that NULL and
duplicate values are not allowed in that column
OR
(II)
A) Write an SQL command to remove the column ADD_PHONE_NO
from a table, named STUDENT.
OR
B) Write an SQL command to change the data type of the column
PHONE_NO as VARCHAR(10) of table, named STUDENT.

28 A) List one advantage and one disadvantage of BUS topology. 2


OR
B) Expand the term FTP. What is the use of FTP.
Ques. PART C Marks
No.

Page 6 of 12
29 Write a function capit() in Python to read content of a text file 3
‘NOTES.TXT’ and display the entire content in capital letters.
OR
Write a function Disp_Lines() in Python which should read lines from a
text file MYFILE.TXT and display the lines starting with the alphabet T.
30 A) You have a stack named ItemsStack that contains records of 3
Items.
Each Item record is represented as a list containing Item_title,
name, and price. Write the following user-defined functions in
Python to perform the specified operations on the stack
ItemsStack:
(I) push_Item(ItemsStack, new_Item): This function takes the
stack ItemsStack and a new Item record new_Item as
arguments and pushes the new Item record onto the stack.
(II) pop_Item(ItemsStack): This function pops the topmost Item
record from the stack and returns it. If the stack is already
empty, the function should display "Underflow".
(III) (III) peep(ItemsStack): This function displays the topmost
element of the stack without deleting it. If the stack is empty,
the function should display 'None'.
OR
(B) Write the definition of a user-defined function `push_div(N)` which
accepts a list of integers in a parameter `N` and pushes all those integers
which divisible by 5 from the list `N` into a Stack named `Numbers`.
Write function pop_div() to pop the topmost number from the stack and
returns it. If the stack is already empty, the function should display
"Empty".
Write function Disp_div() to display all element of the stack without
deleting them. If the stack is empty, the function should display 'None'
For example: If the integers input into the list VALUES are: [15, 25, 28,
23, 20] Then the stack `Numbers` should store: [15, 25, 20]
31 Predict the output of the following code : 3

Page 7 of 12
d={"IND":"DEL","SRI” :"COL","CHI":"BEI"}
str1=""
for i in d:
str1=str1+str(d[i])+"@"
str2=str1[:–1]
print (str2)
OR
L=[1,2,3,4,5]
Lst=[]
for i in range(len(L)):
if i%2==1:
t=(L[i],L[i]**2)
Lst.append(t)
print(Lst)
Ques. PART D Marks
No.
32 Consider the table CHIPS as given below: 4

TABLE: CHIPS

BRAND_NAME FLAVOUR PRICE QTY

LAYS ONION 10 5
BIKANO TOMATO 20 12
UNCLE CHIPS SPICY 12 10
KALEVA PUDINA 10 12
HALDIRAM SALTY 10 20
HALDIRAM TOMATO 25 30

Write the following queries:


a) To display the total Quantity for each Brand_name.
b) To display the table sorted by price in ascending order.
c) To display the distinct flavour from the Chips table

Page 8 of 12
d) To display names of those brands whose name have anywhere ‘K’
in their Brand_name .
OR

(i) Select max(price) from CHIPS;

(ii) Select count( distinct (BRAND_NAME)) from CHIPS;

(iii) Select price , price *1.5 from CHIPS where FLAVOUR =


“PUDINA”;

(iv) Select BRAND_NAME, count(*) from CHIPS group by


BRAND_NAME;
33 A csv file "stud.csv" contains the data of a book. 4
(i) ADD() – To accept and add data of an student to a CSV file
‘book.csv’. Each record consists of a list with field elements as bookid,
name, qty to store in ‘book.csv’.
(ii) COUNTR() – To count the number of records present in the CSV
file named ‘book.csv’ for those books having qty more than 25.
34 Write the outputs of the SQL queries (i) to (iv) based on the 4

relations Teacher and Placement given below:


Table : Teacher
T_ID Name Age Department Date_of_join Salary Gender
1 Arunan 34 Computer Sc 2019-01-10 12000 M
2 Saman 31 History 2017-03-24 20000 F
3 Randeep 32 Mathematics 2020-12-12 30000 M
4 Samira 35 History 2018-07-01 40000 F
5 Raman 42 Mathematics 2021-09-05 25000 M
6 Shyam 50 History 2019-06-27 30000 M
7 Shiv 44 Computer Sc 2019-02-25 21000 M
8 Shalakha 33 Mathematics 2018-07-31 20000 F
Table : Placement
P_ID Department Place
1 History Ahmedabad

Page 9 of 12
2 Mathematics Jaipur
3 Computer Sc Nagpur

(i) SELECT Department, max(salary) FROM Teacher


GROUP BY Department;
(ii) SELECT MAX(Date_of_Join),MIN(Date_of_Join) FROM
Teacher;
(iii) SELECT Name, Salary, T.Department, Place FROM
Teacher T, Placement P WHERE T.Department =
P.Department AND P.Department='History';
(iv) SELECT Name, Place FROM Teacher natural join
Placement where Gender='F';
OR
To display the Cartesian Product of these two tables
35 4
(b) Write a function adds a new column in the table Student, updates
the data into it and displays the content of the table.
Student table details are as follows:
Rollno – integer
Name – string
Marks – integer

Note the following to establish connectivity between Python and MYSQL:


• Username is root
• Password is sys
• The table exists in a MYSQL database named school.
Write the following Python function to perform the specified operation:
InsertAndShow(): To input details of student and store it in the table
STUDENT. The function should then retrieve and display all records from
the STUDENT table where the Marks is greater than 75.
Ques. PART E Marks
No.

Page 10 of 12
36 Write a Program in Python that defines and calls the following user 5
defined functions:
• ADD() – To accept and append data of an item to a binary file
‘furniture.dat’. Each record of the file is a list [Fur_id, Description,
Price, and Discount]. Fur_Id and Description are of str type, Price
is of int type, and Discount is of float type.
• UPDATE() – To change discount as 5000 for furniture item whose
Description is ‘Computer Table’.
• COUNTR() – To count the number of records present in
‘furniture.dat’ whose price is less than 5000.
37 Total-IT Corporation, a Karnataka based IT training company, is planning 5

to set up training centers in various cities in next 2 years. Their first


campus is coming up in Kodagu district. At Kodagu campus, they are
planning to have 3 different blocks, one for AI, IoT and DS (Data
Sciences) each. Each block has number of computers, which are
required to be connected in a network for communication, data and
resource sharing. As a network consultant of this company, you have to
suggest the best network related solutions for them for issues/problems
raised in question nos. (i) to (v), keeping in mind the distances between
various blocks/locations and other given parameters.

Distance between various blocks/locations:


Block Distance
IT to DS 28 m
IT to IoT 55 m
DS to IoT 32 m

Page 11 of 12
Kodagu Campus to Coimbatore Campus 304 km

Number of computers:
Block Number of Computers
IT 75
DS 50
IoT 80

(i) Suggest the most appropriate block/location to house the


SERVER in the Kodagu campus (out of the 3 blocks) to get the
best and effective connectivity. Justify your answer.
(ii) Suggest the best wired medium and draw the cable layout (Block
to Block) to most efficiently connect various blocks within the
Kodagu Campus.
(iii) Suggest the placement of the following devices with appropriate
reasons: a) Switch/Hub b) Router
(iv) Is there a requirement of a repeater in the given cable layout?
Why/ Why not?
(v) Suggest a protocol that shall be needed to provide Video
Conferencing solution between Kodagu Campus and Coimbatore
Campus.
OR
What type of network (PAN, LAN, MAN, or WAN) will be set up
among the computers connected in the Kodagu campus.

Page 12 of 12

You might also like