Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

PB-1 CS Jaipur Region

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

Ahl/ROLL NO teSET: 01

KENDRIYAVIDYALAYA SANGATHAN,JAIPUR REGION


yT ats yraT / 1ST PRE BOARD EXAMINATION :2024-25
G41T/ CLASS :XII
fayy ISUB : HT aAG0 (83) /COMPUTER SCIENCE (83)
3TfeH HaÍ ITime Allowed :03 Hours 3rfoH 36 Maximum Marks :70
HIAGY acer /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.
SectionCconsists of 3questions (29 to 31). Each question carries 3 Marks.
Section Dconsists of 4 questions (32 to 35). Each question carries 4 Marks.
Section Econsists of 2 questions (36 to 37). Each question carries 5 Marks.
All programmingquestions are to be answered using Python Language only.
In the case of MCQ, the text of the correct answer should also be written.

Section-A {21 x 1 = 21 Marks) Mark


1 State Trueor False: 1
The keys of adictionary must be of immutable types.
2 ldentify the output of the following code snippet: 1
str = "KENDRIYA VIDYALAYA"
str=str.replace(YA', *")
print(str)
a) KENDRIYAVIDYALAYA (b) KENDRIA VID*ALAYA
(c) KENDRI* VID*LA* (d) * KENDRI" VID*LA*
3 What willbe the output of following expression? 1
(5<10 ) and (10< 5)or (3<18) and not 8<18
(a)True (b) False (c) Error (d) No output
4 What is the output of the expression? 1
St1="abc@pink@city"
print(St1.split("@")
(a) ("abc", "@", "pink', "@", "city") (b), [abc", "@", "pink""@"city"]
(c) ["abc", "pink", "city"] (d) Error
5 What will be the output of the following code snippet?
message= "Satyamev Jayate"
6
print(message[-2::-2])
Which of the following options will not result in an error when performed on types in 1
python where tp = (5,2,7,0,3) ?
(a) Tp[1] =2 (b)tp.append(2)
Kc) tp1 = tp+tp (d) tp.sum( )

Page 1 of 7
following statements will
f my_dict is adictionary as defined below, then which of the 1

raise an exception?
my_dict ={'aman': 10, 'sumit': 20, 'suresh': 30}
(a) my_dict.get('suresh') (b) print(my_dict['aman', 'sumit])
(C) my dict['aman']=20 (d) print(str(my dict)
Þ Which of the following can delete an element from a list if the index of the element is
given?
(a) pop( ) (b)remove( )
(c) clear(O (d) allof these
9 Which of the following attributes can be considered as achoice for primary key?
(a) Name (b) Street
(c)Roll No (d) Subject
10 Write the missing statement to complete the folowing code: 1
file = open("abc.txt","r")
d= file.read(50)
#Move the file pointer to the beginning of the file
next_data = file.read(75)
file.close()
11 State whether the following statement is True or False: 1
An exception may be raisedeven if the program is syntactically correct.
12 \What will be the output of the following Python code ? 1
V= 50
def Change(n):
global v
V, n =n, v
print(v, n, sep = #, end ="@")
Change(20)
print(v)
(a)20#50@20 (b)50@20#50
(c)50#50#50 (d) 20@50#20
13 Which statement is used to modify data in a table?
(a) CHANGE (b) MODIFY (c) UPDATE (d) ALTER
14 How would you return all the rows froma table named"Item" sorted in descending 1
order on the column "IName"?
(a)SELECT * FROM Item SORT"IName' DESC:
(b) SELECT *FROM Item ORDER BY IName DESC :
(c) SELECT * FROM Item ORDERIName DESC:
(d) SELECT * FROM Item SORT BY 'IName' DESC;
15 LIKE clause is used for. 1
(a) For pattern matching (b) For table matching
(c) For inserting similar data in a table (d) For deleting data from atable
16 Count(") method count
(a) NULL values only (b)Empty Values
(c) ALL the values (d) None of these
17 The term HTTP stands for? 1
(a) Hyper terminal tracing program (b) Hypertext tracing protocol
(c) Hypertext transfer protocol (d) Hypertext transfer program
18 A device that connects networks with different protocols
(a)Switch (b) Hub (c) Gateway (d) Proxy Server
19 Which switching technique follows the store and forward mechanism? 1

Page 2 of 7
Z0 and Q21 are Assertion(A) and Reason(R) based questions. MarK the core
choice as:
(a) Both A and R are true and R is the correct
(b) explanation TorA
Both A and R.are true and.R.is-not the correct-explanation
(c) A is True but R is for A
(d) A is False but R is
False
True
20 ASSertion :-A parameter having a default value in the function header is known as a 1
default parameter.
Keason:- The default values for paramelers are considered only if no value is
provided for that parameter in the function call statement.
21 Assertion :- Both WHERE and HAVING clauses are used to specify conditions.
Reason:- The WHERE and HAVING clauses are interchangeable.

Q Section-B(7 x 2=14 Marks) Mark


22 What are immutable and mutable types? List immutable and mutable types of 2
python.
23 ||fgiven A=2,B=1,C=3, What will be the output of following expressions: 2
() print(A>B) and(B>C) or(C>A))
I() print(A*B**C)
24 Write the most appropriate list method to perform the followingtasks. 2
()A) To delete a given element from the list L1.
OR
B) To sort the elements of list L1 in ascending order.
(U) A) To add an element in the beginning of the list L1.
OR
B) To add elements of a list L2in the end of a list L1.
25 What possible outputs(s) are expected to be displayed on screen at the time of 2
execution of the program from the following code? Also specify the maximum
values that can be assigned to each of the variables FROM and TO.
import random
AR-[20,30,40,50,60,70]
FROM=random.randint(1,3)
TO=random.randint(2,4)
for Kin range(FROM,TO):
print (AR[K],end="#")
()10#40#70# (i)30#40#50# (ii)50#60#70# (iv)40#50#70#
26 Rewrite the folowing code in Python after removing allsyntax error(s). Underline 2
leach correctiondone in the code.
p=30
for c in range(0,p)
If c%4==0:
print (c*4)
Elseif c%5==0:
print (c+3)
else
print(c+10)
27 ()(A)What constraint should be applied on a table column so that duplicate 2
values are not allowed in that column, but NULL 0s allowed.
OR
Page 3 of 7
a table column so that NULL is not
(B) What constraint should be applied on
allowed in that column, but duplicate values are allowed.
(ii) from a table,
(A)Write an SQL command to remove the Primary Key constraint
named MOBILE. MID is the primary key of the table.
OR
B) Write an SQL command to make the column M_ID the Primary Key of an
already existing table, named MOBILE.
28 (A)How is it easier to diagnose fault in Star topology than in Bus topology ? 2
OR
(B)Nirmala is a bit confused between the terms Web server and Web browsers.
Help her in understanding both the terms with the help of suitable example.
Section-C(3 x3=9 Marks) Mark
29 (A) Write a Python function that count the lines start with the word "ihe" in a file 3
xyz.txt" and display it at the end.
OR
B) Write a Python function that Count total number of vowels in a file
30 (A)Madhuri has a list containing 10 integers. You need to "abc.txt".
help him create a 3
program
with separate user defined functions to pertorm the following
this list. operations based on
Traverse the content of the list and push the ODD numbers into a stack.
" Pop and display the content of the stack.
For Example:
If the sample Content of the list is as followS:
N=[12, 13, 34, 56, 21, 79, 98, 22, 35, 38]
Sample Output of the code should be:
|13,21,89,35
OR
(B) Saroj have a list of 10numbers. You need to help him create a
program with
separate user defined functions to perform the following operations based on this
list.
Traverse the content of the list and push the numbers into a stack which are
divisible by 5.
Pop and display the content of the stack.
For Example:
|f the sample Content of the list is as follows:
N=[2,5,10,13,20,23,45,56,60,78]
Sample Output of the code should be:
5,10,20,45,60
31 (A) Predict the output of the Python code given below: 3
def func(n1 = 1, n2= 2):
n1= n1 * n2
n2= n2 +2
print(n1, n2)
func( )
func(2,3)

Page 4 of 7
OR
(B) Predict the output of the Python code given
T= "20", "50", "30", "40"] below:
Counter=3..
Total= 0
for Iin [7,5,4,6]:
newT=T[Counter]
Total= float (newT) + |
print(Total)
Counter=Counter-1
Mark
Section-D (4 x 4 = 16 Marks) 4
32 Write SQL queries for ()to(iv), which are based on the table: ACTIVITY given
below:
Table:ACTIVITY
PrizeMoney ScheduleDate
ACode ActivityName ParticipantsNum
10000 23-Jan-2004
1001 Relay100x4 16
12000 12-Dec-2003
1002 Highjump 10
8000 14-Feb-2004
1003 ShotPut 12
9000 01-Jan-2004
1005 LongJump 12
10 15000 19-Mar-2004
1008 DiscussThrow
descending order.
i) To display the name of all activities with their Acodes in
participants
(ii) To display sum of PrizeMoney for each of the Number of
groupings (as shown in column ParticipantsNum(10,12,16).
(iii) To display the Schedule Date and Participants Number for the activity
Relay100x4.
(iv) Toincrease PrizeMoney by500for High jump activity
OR
Write output for SQL queries(i) to(iii) and query for (iv), which are based on the
table: ACTIVITY:
(i) select count(distinct ParticipantsNum) from ACTIVITY;
(ii) select max(ScheduleDate),min(ScheduleDate) from ACTIVITY;
(ii) select sum(PrizeMoney) from ACTIVITY;
(iv) Write aquery to delete the record of Acode 1003.
33 Abhishek is making a software on "Countries &their Capitals" in which various 4
records are tobe stored/retrieved in CAPITAL.CSVdata file. It consists of some
records. As a programmer, you have to help him to successfully execute the
program.

(A)Write a function in Python named AddNewRec(Country,Capital) to append


following records in the file "CAPITAL.CSV".
FRANCE","PARIS"]
SRILANKA","COLOMBO"]
(B)Write a function in Python named ShowRec( ) that will show all the contents of
CAPITAL.CSV
34 Write SQL commands for the queries (i) lo (ii) and'output for (iv) &(v) based
on a table COMPANY and CUSTOMER.

Page 5 of 7
COMPANY
CID CNAME CITY
111
PRODUCTNAME
SONY DELHI TV
222 NOKIA MUMBAI MOBILE
333 ONIDA DELHI TV
444 SONY MUMBAI MOBILE
555
666
BLACKBERRY MADRAS MOBILE
DELL DELHI LAPTOP

CUSTOMER
CUSTID NAME
101
Rohan Sharma
PRICEQTY CID
102 70000 20 222
103
Deepak Kumar 50000 10 666
Mohan Kumar 30000 5
104 111
SahilBansal 35000
105 333
Neha Soni 25000 7
106 444
107
Sonal Aggarwal 20000 5 333
) To display those Arjun Singh 50000 15 666
than 30000. company name along with price which are having price less
(ii) To display the name and
to 35000.
price of the companies whose price is
between 20000
(iii) To increase the price by
1000 for those customer whose name
(iv) To display those product name, city starts with 'S'
as MOBILE. and price which are having product name
35 Kabir wants to write a
program in Python to insert the following record
named Student in MYSQL database, SCHOOL: in the table 4
rno(Roll number) - integer
name(Name) - string
DOB(Date of Birth) Date
- Fee-float
Note the followingto establish connectivity
Username- root between Pythonand MySQL:
Password - tiger
Host - localhost
The values of fieldsrno, name, DOB and fee
has to be accepted from the user.
Help Kabir to write the program in Python.
Q Section-E(2 x 5 = 10 Marks)
36 Amit is a manager working in a Mark
recruitment agency. He needs to manage the
records of various candidates. For 5
this, he wants the following information of each
candidate to be stored: -
Candidate |D-integer
Candidate Name - string
Designation - string
Experience -float

Page 6 of 7
You, as a programmer of the company, have been assigned to do this job for Amit.
i)Write a function to input the data of a candidate and append it in a binary file.
(ü) Write afunction to update the data of candidates whose experience is more
than 12.years.and.change.their.designation.to"Sr. Manager".
(ii)Write a function to read the data from the binary file and display the data of all
those candidates who are not "Sr. Manager".
37 PVS Computers decided to open anew office at Ernakulum, the office consist of 5

FiveBuildings and eachcontains number of computers. The details are shown


below.
Buiiding2
Building-1 Building-3

Building-4
Building-5

Distance between the buildings

Building No of computers
Building 1and 2 20 Meters 40
Building 2 and 3 50 Meters 2 45

120 Meters 110


Building 3 and 4 70
4
Building 3and 5 70 Meters 5 60

Building 1and 5 65 Meters

Building 2 and 5 50 Meters

connect network in buildings.


The Company has now decided to
building) to house the server of this
i)Suggest the most suitable place (i.e.
suggested location.
organization. Alsogive a reason to justify your
Answer with justification.
(ü) Where would youplace Hub/Switch?
between the buildings (Topology).
(üü))Suggest a cable layout of connection
in the campus? Why
(iv) Doyou think anywhere Repeaters requiredprovide Video Conferencing solution
(v) Suggest a protocol that shall be needed to
between Ernakulum Campus and RanchiCampus.
OR
among the
What type of network (PAN, LAN, MAN, or WAN) will be set up
computersconnected in the Ernakulum campus?

Page 7 of 7

You might also like