0% found this document useful (0 votes)
712 views8 pages

I Pre-Board Exam Computer Science, 2024-25

Uploaded by

akshitrana88915
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)
712 views8 pages

I Pre-Board Exam Computer Science, 2024-25

Uploaded by

akshitrana88915
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/ 8

No.

ofPrinted Pages : 14 AGRO

I Pre-Board Examination, 2024-25


Sub: Computer Science
Time : 3.00 Hrs. ] Class - XII [ M. M. : 70 .

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.


(21 x 1 = 21 Marks)
Section-A
1. State True or False :
(1)
As a Dictionary is mutable, both Key & Value are also mutable.

2. Identify the output of the following code snippet:

remark = "SQL - Structured Query. Language"

note = remark [2:18]. split O

print(note)

(A) ['L', '-', 'Structured', 'Qu']

(B) ['L', '-', 'Structured', '']

(C) ('L', ' -', 'Structured', 'Q']

(D) 'L - Structured Q' (1)


Computer Science/XJI/AGRO [ P.T.O.
.3. [ 2 )
Write~ output of the following python expression:
[ 3 1
Print ((4>5) and (21=1) or (4<g)) tatement from ltttfallowing:
6. identify the invalid python s
<Al Run Time Error
(Bl Logical Error (A) t=(100) (B) t=tupleO
(q False (1)
4. (D) True (1) (0) None of the above
What is the output of the expression? (C) t=(100,) lumn:
STR="trip@split" 9. Choose the correct statemen t from the following about a primary key co

PrintCSTR.rstrip("t")) (A) Cannot have NULL va 1ues and can have UNIQUE values.

(A) rip@spli (Bl Can have NULL as we II as UNIQUE values.


(Q (Bl trip@spli
rip@split (C) Cannot have NULL an d cannot have UNIQUE values.
5. rip@spli
(D) (1)
(1)
What will be the output of the following code snippet? (D) Can have NULL but not UNIQUE values.
gist::"Old is Gold"
10. . PY than statement:
Consider the following
X==gist.partition("s'1
printOCH:-31) F=open("TEST.txt")

(A) 0 (B) Which of the following .is an •inva 1·Id st atement in python? . • "
("Gold ')
(C) (' Gold', 'is') (B) F.wnte( PASS )
(A) F.seek(0)
(D)
6. None of the above (D) None of the above
What will be the output of the following code? (1) (Q F.read0

Mainlist == ["One", ["2", "3"], "4"] 11. h ther the following statement .Is True or False:
State w e block:' l1)
Checklist= [ Mainlist[1]] "More than one exception is not allowe d .In a single try

print(Checklist) 12. What will be the output of the following code:

(A) ["2"] Local=100


(.)3) ["2", "3"]
(C) [ ["2","3"J l def Update(Global=O):
(D) Syntax Error
7. (1)
If "diet" is a dictionary as defined below, then which of the following statements will raise an global Local
exception?
Local + = Global

.diet = {'Rose': 10, 'Lily': 20, 'Sunflower': 30} print(Local, "#", Global)
(A) dict.get('Sunflower')
(BJ print(dict['Rose', 'Lily'])
(C) dict['Rose']=40
(D) print(str(dict)) Update(SO)
(1) (1 )
Computer Scie11ce/XJIIA GRO
UpdateO

Computer Science/XIIIAGRO
WhichSQL command can d [ 4 I
What will be the output of thecrease Ca rdinality of a Relation? (1)
nd
Q20 and Q21 are Assertion (A) a Reasonlll) "-clquestio-. Mailt"'8
"SELECT name FROM query? e
student WHE
(A) Di spay
I name of stud RE name like '%ar%'; as: th
(A) Both A and R are true and R is e con.ct explanation for A.
Dis ents Whose
(B) play details of t name ends with 'ar'. the
s Udents (Bl Both A and R are true and R is not con.ct explanation for A.
(C) Displ ay name of stud Whose name ends with ·ar'.
ents (C) A is True but R is false.
(D) D"isplay details of stud Whose name has 'ar' anywhere in
(D) A is False but R is True.
M '""'""' oam,
15. s. Meera(a database adm·inistrator)
. ose
. name has 'ar' anywhe rem
. name. Assertioo(J\) , o,ra,1t ,,g,meots io • r,octi 00 • • " " " to ,.;go"'"'"'«> s""' . . -"'
20.
waots
>rut to '"" the DATA TYPE .mSOch • m,
" thiokiog to c<eatea col ,mo m • table,o which sh
(t I which values are not passed at the ti!Tle of function call.
,~sootm , It • maodMry to ha,• d,fa,lt "''- to all param•"" comd'9 "" rig!< slde of
memory of ON(y of the actual
data type h "'1,ev,h
°""
that col umn contains maxim 0 '
,m 120 charnc•a
s e should prefer f aracters entered b any default parameter ·i n the function header. (1)
(A) LONG "the Col,mo O y the,sec is ocwpied Wh,ch
om the following? Assertion(A) . A column size may be updated in an already created relation.
21
Reasootm , The si,e ohOO ,o,mo m., b• ;,creased s, ,siog UPDATE SQL comm•"'-4
~'
(B) CHAR (\l
·(C) Section-S (. 1 ,._ 1...'\
VARCHAR

16. Which one of th (D) DATE Wh" ,S ,he ,~ of ',n" opmt~l ld~t\fy f,om "" foil""'"" \n '""'°' ,~ oO"'"" m.,"'
(A e followin g SQl da,s~ ,s alwa (')
) WHERE ys used in the end of any SQL query? 22.
used·-
(C) HAVING (B) ORDER BY
"ONE', l1), \1,2,31, 23
(1)
Which protocol . (D) GROUP BY Consider the following python code sn\ppet.
17.
is used for download in & ' 23. # Statement· 1
(A) HTTP g uploading files over the Internet?
for C in range(1,10):
(B) VoIP # Statement-2

(C) ii C>S:
FTP # Statement-3
Which network d . . SMTP printlC .end="")
18. ev1ce IS used to make com · (D) (1) # Statement-4
(A) HUB ing weak signals into strong and th en forward?
break

(C) MODEM (B) SWITCH Write the output of the abo11e code in the fo\\owin9 2 cases·.
19. . (D) REPEATER (1)
1. Staternent-4 is a comment &
1s the str ucture/arrangement of (1 )
Computer SdencetvTT/
· :.;u~/AGRO computers connected in a network 2. Staternent-4 is not a comment.

Computer Science!XIIIAGRO
7
24. Consider the give 6 )
[
L.
~
n below
- ·
ftftl.. lsts L1 & L2 and ansW!!r the following
print(Yl

Ll = [10, 10• 20, 10, 30 .,


U- , .. OJ etsei fY-<10: (2)
- (0, 1, 2.....
1 ., 0 ,1] form in range(S,0,-1J:

1. print(thank you)
(a) Write pyth
on comm
and to delete last element from list L2 Whal """"''°I sh<>"ld t,, ,ppMd oo a ""' ,ol""" "' .,,1 ,al"'..,..... by
(b) Write pyth OR
27
1. (a)
I,. ""' '" ih•I col""" m"'I "' '" a ""°''' """' of "'"" ""' o"""' ••
on command OR
Write pyth to count 20 from list L1.
2. (a) Whal oomu,iol sho,ld be ,pplied oo a lable oofomo so ,Sal .,, ,,,1,mo m,.1
on command to add [1, 0, 2] .in the end of list L2.
(bl
not have NULL values & duplicate values? 1
(b) Write python com OR Wri<e d• sac oommaod 10 101 1h• mm~ of all II" ,ables ,11eady ,,.,ied " lh•
25. What p ossI'b le outputs(s) are rnand to sort list
. L1 in ascending order (a)
2.
"• pmg,am fro '<Pect,d lo be a;, 1, OJ database.
to each f m the following code? Al ·pry yed on screen at the time of execution of
OR
'n,r - -o the
r variabl es BEG and END. so spec1 the maxim
um values that can be assigned (bl Wnte the SQL comm•"" u, \'1$\ the detalls{all column name•. data t-Jpe>, .,.-ze,
l2)
andom - ~-
constraint) of a table ·PLAYER
HEIGHTS= [ 10 0
BE~random.
END=random
~!
• ~O , 40 , 50]
ndint (0, 2) 28
(Al Expand MODEM Wnte the use of MODEM in r,et""orking
(2)
. ranctint (2, 4) OR

1
print ra nge (BEG, ENO) :
X Expand XML Wnte one benefil ol XML over HTML (3 x 3 == 9 Marks)
(8)
(A) 30@ (HEIGHTSIXJ,end="@")
(BJ Section•C
10@20@30@40@50@
Wnte a funct,on COUNTLlNES_ET0 in python to read t,nes from a text file REPORT.il<T and
R(CJ 20@30 (D) 40@ (2)
29 COUNT those hr,es which are starting either with 'E' and •T' respectively. And display the Total
26. ewnte the foll . 30@
co . owing code in Python after removing all
rrect1on done in the code. syntax error(s) Underline each
count ,eparJtely

Y=integer(ln put(•Enter 1 or 1Di)


For e,arnple 11 REPORTTXT consists of
ifY::10 "ENTRY LEVEL OF PROGRAMMING CAN BE LEARNED FROM PYTHON. ALSO, IT IS VERY

for y 1
FLEXIBLE LANGUGAE THIS WILL BE USEFUL FOR VARIETY OF USERS"
C.011/pllfer £ . n range(1 , 11).
c1e11ce/XfUA GRO
Co111p11tcr Scie11ce!XIIIAGRO
[ 9 ]
I s I
'""'"- Output WIii be: k): This function displays the topmost element of the
(Ill) Peep(Emp_Stac
No of Unes with E. 1 . deleting it. If the stack is empty, the function shoulddisptay
stack without
No. of Lines with T: 1
'None'.
OR
OR

Write a function SHOW_TODOQ in python to read contents from a text file XYZ.TXT and D STATE contains the record in the following fonnat
(B) A dictionary name d -
display those lines which have occurrence of the word "TO" or "DO". { Country : State)

Also, a stack name STATE(a list) will store the names of the states.
For example : If the contents of the file are:

"THIS IS IMPORTANT TO NOTE THAT SUCCESS IS THE RESULT OF HARD WORK. WE ALL ARE
Define the following functions with the given specifications: II
EXPECTED TO DO HARD WORK. AFTER ALL, EXPERIENCE COMES FROM HARDWORK:'
(I)
. .
Push_State(D_STATE): It takes the d1ct1onary as an arg ument and pushes a

the states in the stack STATE whose state name •is 1ess than 1o characters.
The function should display lines:
(II) Pop_StateO: This function pops the topmost state f ro m the stack STATE
1\-1\S IS \MPOR1AN110 NOTE THAT SUCCESS IS THE RE.SULT OF HARD WORK.
. n should display
and returns it. Also, if the stack is already empty, the functio
WE ALL ARE EXPECTED TO DO HARD WORK. (3)
"Empty".
30. (A)
A stack named Emp_Stack that contains records of Employees. Each Employee record
(Ill) Disp_StateQ: To display all elements of the stack S:t'ATE without deleting them.
is represented as a list containing ' (3)
If the stack is empty, the function should display 'None·
[Emp_No, Emp_Name, Salary]
31 Predict the output of the following code:
Write the following user-defined functions in Python to perform the specified operations
Msg="CompuTer"
on the stack Emp_Stack:
Msg1=""
(I) Push_Emp(Emp_Stack, New_Emp): This function takes the stack Emp_Stack
for I in range(O, len(Msg)):
and a new employee record New_Emp as arguments and pushes the new
if Msg[l].isupperQ:
employee record onto the stack.
Msg 1 =Msg 1+ Msg[l].\owerO
(II) Pop_Emp(Emp_Stack): This function pops the topmost employee record from
ehf 1%2==0:
the stack and returns it. If the stack is already empty, the function should display
Msg1 =Msg1 +'*'
"Underflow".
Computer Science/XJ//AGRO Computer Scie11ce/XJI!AGRO
[ 11 1
[ 10
else: To display the no. ofSURGERYs whose FEES is less than 12000andQDPisfldt
IV.
Msg1 =Msg1 +Msg(l].upperO "301".
print(Msg1) OR

(Bl Write the output of the given below SQL queries:-


OR
tuple1 = (11 ' 22• 33, 44, 55 ,66) SELECT DISTINCT OTNO FROM SURGERY;

li 5t 1 =list(tuple1) SELECT OTNO, COUNT(*), MIN(FEES) FROM SURGERY GROUP BYOTNO HAVING
II.
new_list = U
COUNT(OTNO)> 1;
for i in list1: Ill. SELECT SNAME FROM SURGERY WHERE FEES>=1 SOOO ORDER BY SNAME;
ifi%2==0: IV. SELECT AVG(FEES) FROM SURGERY WHERE FEES BETWEEN 15000 AND
new_list.append(i) (4)
19000;
new_tuple = tuple(new_list) A csv file "Population.csv" contains the population dat; of various cities. Each record of the file
33.
print(new_tuple)
(3) contains the following data:

Section-D ( 4 x 4 = 16 Marks) ID of the city

32. Consider the table SURGERY as given below- Name of the city

SID SNAME FEES STARTDATE OTNO Population of the city


'
S301 HEART 15000 2021-11-15 302 Area(in sq. mtrs.) of the city

) S302

S303
LIMBS

LEVER
9000

10000
2021 -10-20

2023 -07-02
NULL

301 For example, a sample record of the file may be:


S304 KIDNEY 5000 2024-08-01 NULL
['C001', 'Jaipur', 697000, 5000]
S305 STOMOCH 18000 2024-03-25 302
; Write the following Python functions to perform the specified operations on this file:

(I) Read all the data from the file in the form of a list and display all those records for
(A) Write SQL queries for the following :
which the population is more than 200000.
To display contents of SURGERY table sorted by STARTDATE . d .
order. _ in escend1ng (4)
(II) Count & display the number of cities whose data is stored in the file.

34. Write SQL commands for the following queries (i) to (iv) based on the relations TRAINER &
II. To display the sum of FEES of al/ the SURGERYs for wh.ich the OTNO is NULL.

II/. To display the SURGERY ID & FEES of SUR COURSE given below:
Computer Scie11ce/XJI/AGRO GERYs whose name starts with "D".
Computer Scie11ce/XIIIA GRO
ru
I t% python-DatabaSe
e the following for
I :iaiiii:--r;c;.;~;!t-\IN~~E!,R--,1
I tffiRED~~A!,!TE.;::+S;;;;ALAR;;;;;;-_Y---j As5Um rd· Time
U r: root, passWO .
'I . MUMti.4.1 1998-10-15 90000 (Host: localhost, se ·
'I.. D~ 1994-12-24 80000 secr10NE
'
~
1:1:i .
CffANoroARG
DELru
2001-12-21 s2000
2002-12-25 78000
I .
'
• . college is plann,
MllMBAJ 1996-01-12 95000 Manan, an Exam in-charge of a
~~
36.
t, CifENNAI 2001-12-12 69000 . he want's the ,.,.,; • fo rma t,on o
which are going to be held. For this, v ...,ng ,n

COURSE to be stored:
FEES STARTDA TE TID
12000 2018-07-02 101
15000 2018-07-15 103 Testld - integer
l 0000 2018-10-0 l 102
9000 2018-09-15 104 Subject - string
ioooo 201s.os-01 101
18000 2018-07-25 MaxMarks- integer
105

Display all details ofTrairiers who are living in city CHENNAI. ScoredMarks - integer

fl. Count and Display the number of Trainers in each city You, as a programmer of the college, have beenassigned to do this job for Manan. A

Ill. Display the Course details which have Fees more tha n 12000 and name ends with 'I( binary file named · TEST.du· has some n!CQrds of the structure

IV. (A) Display the Trainer Name & Course Na me from both tables where Course Fees [Testld, Subject, MaxMarks, ScoredMarksJ

is less than 10000. (I) Write a function named NewTestQ to input the data of a il:Si and append it in ·nst.
OR dat binary file.
(Bl Display the Cartesian Product of above two tables. (4)
(II) Wri te a function named UpdateMM(Sub) that will update the MaxMarks of Tests by
35. Atable, named PRODUCT, in PRO_DB database, has the following structure:
Attribute Name Data Type 1oof Subject entered as argument in function.
PIO int(6)
(11 1) Wri te a fu nction in Python named DisplayAvgMarks(Sub) that wi\\ accept a su~
PNAME Varchar(20)
COMPANY Varchar(20) as an argu ment and read the contents ofTEST.dat. The function will calculate &.display
PRICE Float
the Average of the ScoredMarks of the passed ~ubject on screen
Write the following Python function to perform the specified operation. AddNewProductO· To

input details of Product and store it in the table PRODUCT. The function should then retrieve 37. "VidyaDaan" an NGO is planni_ng to setup its new campus at Nagpur for its w

and display all records from the PRODUCT table where the Price is less than 250. activities. The cam pus has four(04) UNITS as shown below:
Computer Scie11ce/XIIIA GRO
Computer Scie11ce!XJI/AGRO
[ 14 ]
* Distances between above UNITs . der
are given as un ·

UNIT-1 DISTANCE(ln mtrs.)


UNIT-2
ADMIN 65
TRAINING
ADMIN RESOURCE 120
ADMIN FINANCE 100
FINANCE TRAINING 60
FINANCE RESOURCE 40
TRAINING RESOURCE 50
* No. of Computers in various UNITs are·
UNIT NO OF COMPUTERS
ADMIN 150
FINANCE 25
TRAINING 90
RESOURCE 75
I. Suggest an ideal cable layout for connecting the above UN ITs.
II. Suggest the most sU1table place i.e UNIT to install the server for the
above NGO.
Ill Which network device 1s used to connect the computers in all UNITs?
IV. Suggest the placement of RepC'ater in the UNITs of above network.
V. (A) NGO is planning to connect its Regional Office at Kota, Rajasthan.
Which out of the
following wired communication, will you suggest for a very high-speed
connectivity?
(a) Twisted Pair cable (b) Ethernet cable (c) Optica l Fiber
OR

(B) What type of network (PAN, LAN, MAN, or WAN) will be set
up among the

computers connected in the NAGPUR campus?

Computer Scie11ce/Xll/AGRO

You might also like