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

Cs Pre-Board 1

Uploaded by

achangdota
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)
159 views12 pages

Cs Pre-Board 1

Uploaded by

achangdota
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

ZZZ-1207

Please check total printed pages before start: 12


Roll No. :

PRE-BOARD EXAM. -1 2024-25


CLASS: XII
SUBJECT: COMPUTER SCIENCE
Time : 3 Hours Max. Marks : 70
General Instructions:
This question paper contains 37 questions.
All.questions are compulsory. However, internal choices have been
prqvided in some questions. Attempt only one of the choices in
suçh questions
ThÇ 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 Cconsists of 3 questions (29 to 31). Each question carries
3 Marks.
Section D consists of 4questions (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.
SECTION-A (21 X 1 = 21 MARKS)
State True or False: "Variable deciaration is implicit in Python." 1
2 Select the correct output of the code:
SE "last#ball"
pfint(S.strip(""))
[P.T.O.]
ZZZ-1207 2
(a) ast#ba (b) ast#bal
(c) last#ba (d) ast#ball
3
Evaluate the following expression:
16 - (4 + 2) * 5 + 2**3 * 4
(a) 54 (b) 46 (c) 18
4
(d) 32
Select the correct output of the 1
code: 1
Text = "Python
Programming'
print(Text. split('P')
(a) 'ython', 'rogramming'] (b) , 'ython',
(c) , 'ython',
'programming'] rogramming']
(d) [python', 'rogramming']
5 What will be the output of the
str = Welcome to Python world"
following code snippet:
print(str[: : -3]) 1
6 Which of the following will give an- error in
'a', 7.8) Python for a tuple t=(4,
(a) print(sum(t) (b) t=(1,2,3)
(c) a,b,c = t
7
(d) print(len(t)
If mdict is adictionary as defined below, then which of the following
statements will raise an exception? 1
mdict = {red': 100, 'black': 200, white': 300}
(a) mdict.get(300) (b) mdict['red']-=20
(c) print(mdict[ black', white']) (d) print(str(mdict)
Predict the output: 1
L =[23,4,7,12,2]
L1 = L. sort ()
L. insert (2,16)
print (L, '&, L1)
(a) [2,4,7,12,16,23] & (2,4,7,12,23]
(b) (2,4,16,7,12,23] & (2,4,16,7,12,23]
Ac) (2,4,7,12,16,23] & None

(P.T.O.]
ZZZ-1207
(d) None of these
Predict the output for the following code snippet: 1

t= 4,
print(type(t))
(a) <class "int'> (b) <class "tuple'>
(c) No output (d) error
10. The syntax of seek () is: 1
file_object.seek (offset [, reference point])
What is the default value of reference_point?
(a) 0 (b) 1 (c) 2 (d) 3
11 State whether the following statement is True or False: 1
"Every syntax error is an exception but every exXception cannot be
a syntax error." e
12. Write the output of the following Python code: 1
a = 20

def call (x):


global a
X+ = a

return X
X = 15

print(call (30), end= '$)


(a) 35$ (b) 45$
(c) 50$ (d) 65$
13 Write the SQL query to add a primary key to an existing column
'ADNO' in the table 'SRecord'. 1
14. FilI in the blank:
clause is used with SELECT statement to display data
in a sorted form with respect to a specified column.
15 Fill in the blank:
is a number of tuples in a relation.
[P.T.O.]
ZZZ-1207 4
(a) Attribute (b) Degree
(c) Domain
(d) Cardinality
16 Which SQL statement do we use to 1
find out the total number o
records present in the table
ORDERS? 1
(a) Select * from
ORDERS;
(b) Select count() from
(c) Select find(*) from
ORDERS;
ORDERS:
(d) Select sum(*) from
17 ORDERS;
What does HTTPS stand for?
(a) Hyper Text Protocol Secure
b) Hypertext Transfer
Protocol Secure
(c) Hidden Text Transfer
Protocol Station
(d) Hypertext Transfer
18
Protocol Station 1
Which of the following options is the
for network bandwidth? correct unit of measurement
(a) KB (b) bit
(c) Hz (d) Km
19 1
Fill in the blank:
TCP/IP stands for
Q20 and Q21 are
Assertion(A)
Mark the correct choice
andReason(R) based questions.
as:
(A) Both A and R are true and R
is the correct
-(B) Both Aand R are true and R is not explanation for A
the correct explanation for A
(C) A is True but R is False
(D) A is False but R is True
20
Assertion (A) : To use a function from a
particular module, we
need to import the module.
Reason (R) : import statement can be written
anywhere in the
program, before using a function from that module. 1
21
Assertion(A) SQL, the aggregate function
: In
average value on a set of values and produceAVG() calculates the
a single result.

[P.T.O.]
ZZZ-1207
Reason(R): The aggregate functions are used to perform some
fundamental arithmetic tasks such as Min(), Max(), Sum() etc..1
f SECTION-B( 7 X2=14 MARKS)
22
Mithilesh has written a code to input a number and
factorial and then finally print the result in the evaluate its
of the <number> is format: "The factorial
<factorial value>" His code is having errors.
Rewrite the correct code and underline the
f= 0
corrections made.
num = input("Enter a number: ")
n =num

while num > 1:


f=f * num
num - = 1

nent
else:
print (The factorial of: ", num "is", f)
23 Predict the output of the foilowing: 2
1
for i in range (1, 15, 2):
temp = i
if i % 3 = = 0:
1 temp = i + 1
.tions. elif i % 5 = = 0:
continue
elif i = = 11:
for A
1for A
break print(temp, end = '$)
24 If L =[3,5,2,7,8,12,2,19] and L1 = [4,6,3,2,7,12,9] then 2
(i) (A) Write a statement to merge both the lists.
OR
Jle, we
(B) Write a statement to sort the elements in place of list L.
in the (ii) (A) Write a statement to get a new list SL with the elements
1 of L1 in descending order.
ates tht OR
esult.

[P.T.O. [P.T..]
ZZZ-1207 6
(B) Write a statement to insert the last element of list L1 in the
list Lat 5h index.
25 Identify the correct output(s) of the following code. Also write
the minimum and the maximum possible values of the variable
b.
import random
a="Wisdom"
b=random.randint(1,6)
for i in range(0,b,2):
print(a[i],end=#)
AA) W# (B) W# i#
C) W # s # (D) W # i # s #
26 What is the difference between primary key and alternate key? Give
example of each. 2
27 () (A) Write the command to add a column
Percentage in the
Marks. Where the data should be entered as decimal number ie. table
78.3
OR
(B) Write the constraint that will provide value to a column if no
value is inserted in that column.
(ii) (A) Write the command to change the name of a column from
Comm to Commission in the table Product.
OR

(B) Write the constraint that will allow null value but not duplicate
values in the column of a table.
7 ZZZ-1207
For ex - if Para. txt contains the following content
He lives in AB-66, AB Type Quarters.
Then the function should display:
Upper case alphabets - 7
Lower case alphabets 18
Digits 2
OR
(B) Write a method/function countwords() in Python to read
contents from a text file 'DECODE.TXT' to count and return
the occurrence of those worlds which are having 5 or more
characters.
For ex -if DECODE.TXT content is :

These days I am reading a motivational book.


The method/function should display
The words having 5 or more characters are 3.
30 (A) A dictionary, d_city contains the records in the following format:
{state:city} 3

Define the following functions with the given specifications:


(0) push city(d_city):It takes the dictionary as an argument
and pushes all the cities in the stack CITYY whose states are
of more than 4 characters.
(i) pop_city(): this function pops the cities and displays "Stack
empty" when there are no more cities in the stack.
(ii) peep(d_city): This function displays the topmost element of
the stack without deleting it. If the stack is empty the function
should display 'None'.
OR

(B) You have astack named BooksStack that contains records of


books. Each book record is represented as a list containing
book title, author_name, and publication_year. Write the
following user-defined functions in Python to perform the
specified operations on the stack BooksStack:
[P.T.0.]
ZZZ-1207 8
() push book(BooksStack, new book): This function
takes the stack BooksStack and a new book record
new book as arquments and pushes the new book
record onto the stack.
(1) pop_book(BooksStack): This function pops the
topmost book record from the stack and returns it. If the
stack is already empty, the function should display
"Underflow".
(II) peep(BookStack): This function displays the topmost
element of the stack without deleting it. If the stack is
empty, the function should display 'None'.
31 Consider the following table:
TABLE: RENT CAB
Vcode VName Make Color Charges
101 Big car Carus White 15
102 Small Car Ploestar Silver 10
103 Family car Windspeed Black 20
104 Classic Studio White 30
105 Luxury Trona Red
Based on the given table, write SQL queries for the following:
(A)
() Count the number of cars of different colors.
(ii) Display all the details in the descending order of charges.
(i) Display the vcode, vname of the cars whose make has letter
'o' in their name.
OR

(B) () Increase the charges of all the cabs by 10%.


(1) Delete all the cabs whose maker name is Carus'
(m) Display the sum of charges of all cars color-wise.
SECTION-D ( 4X 4 =16 MARKS)

[P.T.0.]
9 Z7Z-1207
32 (A) () Explain Catching exceptions using try and except block.
(1) Give an example code to handle ZeroDivisionError using try
and except block. The code should display the message
"Denominator can't be zero" in case of ZeroDivisionError
exception, and the message "Some other error occurred" in
case of any other exception.
OR
(B) () When is l0Error exception raised in
(ii) Python?
Give an example code to handle IOError
block. The code should display the using try and except
in case of lOError message "File not found
exception, and the message "Some other
error occurred" in case of any
33 other exception. 4
Mr. Mahesh is a Python
to maintain the records ofprogrammer working in a school. He has
the sports students. He has
CSv file named sports.csv to store created a
the details. The
sports.csv :[sport_id, competition, prize_won] structure
is of
Where sport id is sport id (integer)
Competition is competition name (string)
Prize_won is (Gold", "Silver", "Bronze")
Mr. Mahesh wants to write the
following user defined functions:
Add details(): to accept the details of
file, "sports.csv". student and add to a csv
Count Medal(): to display the name the
students have won "Gold medal". competitions in which
Help him in writing the code of both the functions.
34 Consider the tables Games and Players given below: 4
TABLE GAMES
Gcode GameName Type Number Prize Money
101 Carrom BoardIndoor 2 5000
102 Badminton Outdoor2 12000
103 Table Tennis Indoor 4 Null
104 Chess Indoor 2 9000
105 Lawn Tennis Outdoor4 25000

[P.T.0.]
ZZZ-1207 10
TABLE: PLAYERS
Pcode Name Gcode
1 Nabi Ahmad 101
2 Ravi Sahai 108
3 Jatin 101
4 Nazneen 103
Write SQL queries for the following:
() Display the game type and average number of games played
in each type.
(i) Display prize money, name of the game and name of the
players from the tables games and players.
(ii) Display the type of games without, repetition.
(iv) (A) Display the name of the games and prize money of those
games whose prize money is known.
OR

(B) To display the cartesian product of these two tables.


35 Sunil wants to write a function ADRecord() in Python to insert a
record and display the records of the items whose price is between
200 to 300 in the table named Stall in MySQL database named
Maintain
The table Stall in MySQL contains the following attributes:
I_code: item code (integer)
I name: name of item (string)
Quan : quantity of the item (integer)
Amount: price of item (integer)
Consider the following to establish connectivity between Python and
MySQL:
Username - Administrator
Password - market
Host - localhost
SECTION-E (2 X 5 = 10 MARKS)
36 Rakesh is working in an educational Institute. He needs to manage
the records of various students. For this he wants the following
[P.T.0.]
11 ZZZ-1207
information of each student to be stored:
Student id
student Name integer
string
Father name string
Percentage
YOu, as a
float
this job for programmer of the institute, have been assigned to do
() What type Rakesh.
of fileSuggest:
(text file, csv file, or binary
to store this
data? Giye one valid reason file) will you use
to support your
answer.
(l) Write afunction to
input the data of a student and
in the file that you append t
(||) Write a function to suggested in part () of this question.
read the data
suggested in part () of this question fromn the file that you
and display the
37
all those students
whose percentage is more than 85.data 5of
Logistic Technologies Ltd. is Delhi based
expanding its office set-up to Ambala. At Ambala organisation which is
they are planning to have 3 office campus
different
Logistics related work. Each block has ablocks for HR, Accounts and
which are required to be connected to a number of computers,
data and network for communication,
resource´ sharing.
Ambala Office

Delhi HR Block Accounts Block


Head Office

Logistics Block

As a network consultant, you have to suggest the


best
related solutions for them for issues/problems raised in (i)network
to (v),
keeping in mind the distances between various block/ locations and
other given parameters.

[P.T.O.]
ZZZ-1207 12
Distance between various blocks/locations:
HR block to ACcOunts
blocks 400 meters
Accounts block to Logistics block 200 meters

Logistics block to HR block 150 meters


Delhi head office to Ambala office 220 krm
Number of computers installed at various blocks are as
HR block
follows:
70
Accounts block 40
Logistics block 30
() Suggest the most appropriate block/location to house the
SERVER in the Ambala office. Justify your answer.
(i) Suggest the best wired medium to
efficiently connect various
blocks within the Ambala office
compound.
(ii) Draw an ideal cable layout (block to
block) for connecting
these blocks for wired connectivity. 1
(V) The company wants to schedule an online
conference
between the managers of Delhi and Ambala offices. Which
protocol will be used for effective voice
the Internet? communication
over
(v) YA) Which kind of network (PAN, LAN, MAN, WAN) will it
be
between Delhi office and Ambala office?
OR
(B) ls there a requirement of a repeater in the given cable layout?
Why/ Why not?

[P.T.O.]

You might also like