0% found this document useful (0 votes)
186 views7 pages

Computer Science Class Xii Question Paper Hy Exam 2024-25

Uploaded by

Sanjeev Bora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
186 views7 pages

Computer Science Class Xii Question Paper Hy Exam 2024-25

Uploaded by

Sanjeev Bora
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

1

DAV CENTENARY PUBLIC SCHOOL, HALDWANI


HALF YEARLY EXAMINATION (2024-25)
CLASS: XII
SUBJECT: COMPUTER SCIENCE
Time Allowed: 3 Hours Max. Marks: 70
General Instructions:
 This question paper contains 37 questions.
 All questions are compulsory.
 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 Section-A (21 x 1 = 21 Marks) Marks
1 In Python, a variable is a placeholder for data.(True/False) 1
2 Identify the output of the following code snippet: 1
text = “PYTHONPROGRAM”
text=text.replace('PY','#')
print(text)
(a) #THONPROGRAM (b) ##THON#ROGRAM
(c) #THON#ROGRAM (d) #YTHON#ROGRAM
3 Which of the following expressions evaluates to False? 1
(a) not(True) and False (b) True or False
(c) not(False and True) (d) True and not(False)
4 Given the following dictionaries: 1
Dict_exam={‘Exam’: ‘AISSCE’, ‘Year’: 2024}
Dict_result={‘Total’: 500, ‘Pass_Marks’:165}
Which statement will merge the contents of both dictionaries?
(a)Dict_exam.update(Dict_result) (b)Dict_exam + Dict_result
(c)Dict_exam.add(Dict_result)
(d)Dict_exam.merge(Dict_result)
5 What is the output produced by the following code snippet? 1
aList=[1,2,3,4,5,6,7,8,9]
print(aList[::3])
6 What will be the output of the following code snippet? 1
2

values=[]
for i in range(1,4):
values.append(i)
print(values)
7 Write the missing statement to complete the following code: 1
file = open("example.txt", "r")
data = file.read(100)
_________________ #Move the file pointer to the beginning of the
file
next_data = file.read(50)
file.close()
8 State whether the following statement is True or False: 1
An exception may be raised even if the program is syntactically
correct.
9 Which switching method offers a dedicated transmission channel? 1
(a)Packet switching (b)Circuit switching (c)Message switching
(d)None of these
10 What will be the output of the following code? 1
c = 10
def add():
global c
c=c+2
print(c,end='#')
add()
c=15
print(c,end='%')
(a) 12%15# (b) 15#12% (c) 12#15% (d) 12%15#
11 Which of the following functions changes the position of file pointer 1
and returns its new position?
(a) flush() (b) tell() (c) seek() (d) offset()
12 Which protocol is used to transfer files over the Internet? 1
(a) HTTP (b) FTP (c)PPP (d)HTTPS
13 Which network device is used to connect two networks that use 1
different protocols?
(a) Modem (b) Gateway (c)Switch (d)Repeater
14 Data structure stack is also known as ________________list. 1
(a)First in First out (b)First in last out (c)Last in first out
(d)All of these
15 The readlines( ) method returns: 1
(a)str (b)a list of lines (c)tuple (d)dictionary
16 The collection of modules and packages that together cater to a 1
3

specific type of applications or requirements, is called_______.


(a)module (b)library (c)classes (d)documentation
17 Fill in the blank: 1
_____________is a set of rules that needs to be followed by the
communicating parties in order to have a successful and reliable data
communication over a network.
18 Which of the following options is the correct unit of measurement for 1
network bandwidth?
(a)KB (b)Bit (c)Hz (d)Km
19 Identify the statement from the following which will raise an error: 1
(a)print("A"*3) (b)print(5*3) (c)print("15" + 3)
(d)print("15"+"13")
Q20 and Q21 are Assertion(A) and Reason(R) 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
20 Assertion (A): In the case of positional arguments, the function call 1
and
function definition statements match in terms of the number and order
of arguments.
Reasoning (R): During a function call, positional arguments should
precede keyword arguments in the argument list.
21 Assertion(A): List is an immutable data type 1
Reasoning (R): When an attempt is made to update the value of an
immutable variable, the old variable is destroyed and a new variable is
created by the same name in memory.
Section-B ( 7 x 2=14 Marks)
22 Identify the correct output(s) of the following code. Also write the 2
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='#')
(A) W# (B) W#i#
(C) W#s# (D) W#i#s#
23 How is a mutable object different from an immutable object in 2
Python?
4

Identify one mutable object and one immutable object from the
following:
(1,2), [1,2], {1:1,2:2}, ‘123’
24 Give two examples of each of the following: 2
(I) Membership operators (II) Identity operators
25 List one advantage and one disadvantage of star topology. 2
26 Write the output of the code given below: 2
p=5
def sum(q,r = 2):
global p
p = r + q**2
print(p,end= ‘#’)
a=10
b=5
sum(a,b)
sum(r = 5, q = 1)
27 A program having multiple functions is considered better designed 2
than a program without any functions. Why?
28 (a) Write the full forms of the following: (i) SMTP (ii) PPP 2
(b) What is the use of TCP/IP?
Section-C ( 3 x 3 = 9 Marks)
29 Write a Python function that finds and displays all the words longer 3
than 5 characters from a text file "Words.txt"
30 A list contains following record of a customer: [Customer_name, 3
Phone_number, City] Write the following user defined functions to
perform given operations on the stack named ‘status’:
(i)Push_element() - To Push an object containing name and Phone
number of customers who live in Goa to the stack
(ii)Pop_element() - To Pop the objects from the stack and display
them. Also, display “Stack Empty” when there are no elements in the
stack. For example: If the lists of customer details are:
[“Gurdas”, “99999999999”,”Goa”]
[“Julee”, “8888888888”,”Mumbai”]
[“Murugan”,”77777777777”,”Cochin”]
[“Ashmit”, “1010101010”,”Goa”]
The stack should contain
[“Ashmit”,”1010101010”]
[“Gurdas”,”9999999999”]
The output should be:
[“Ashmit”,”1010101010”]
[“Gurdas”,”9999999999”]
5

Stack Empty
31 Write a method in Python to read lines from a text file Mynotex.txt 3
and display those lines, which are starting with an alphabet ‘K’.
SECTION D (4 X 4 = 16 Marks)
32 When is NameError exception raised in Python? 4
Give an example code to handle NameError? The code should
display the message "Some name is not defined" in case of
NameError exception, and the message "Some error occurred" in case
of any other exception.
33 Ranjan Kumar of class 12 is writing a program to create a CSV file 4
“user.csv”
which will contain user name and password for some entries. He has
written
the following code. As a programmer, help him to successfully
execute the
given task.
import _____________ # Line 1
def addCsvFile(UserName,PassWord):
# to write / add data into the CSV file
f=open(' user.csv','________') # Line 2
newFileWriter = csv.writer(f)
newFileWriter.writerow([UserName,PassWord])
f.close()
#csv file reading code
def readCsvFile(): # to read data from CSV file
with open(' user.csv','r') as newFile:
newFileReader = csv._________(newFile) # Line 3
for row in newFileReader:
print (row[0],row[1])
newFile.______________ # Line 4
addCsvFile(“Arjun”,”123@456”)
addCsvFile(“Arunima”,”aru@nima”)
addCsvFile(“Frieda”,”myname@FRD”)
readCsvFile() #Line 5
(a) Name the module he should import in Line 1.
(b) In which mode, Ranjan should open the file to add data into the file
(c) Fill in the blank in Line 3 to read the data from a csv file.
(d) Fill in the blank in Line 4 to close the file.
(e) Write the output he will obtain while executing Line 5.
34 (i)Evaluate the following expressions: 4
a) 6 * 3 + 4**2 // 5 – 8
6

b) 10 > 5 and 7 > 12 or not 18 > 3


(ii) Rewrite the following code in Python after removing all syntax
error(s). Underline each correction done in the code.
Value=30
for VAL in range(0,Value)
If val%4==0:
print (VAL*4)
Elseif val%5==0:
print (VAL+3)
else
print(VAL+10)
35 (i)Write a function in Python that counts the number of “Me” or “My” 4
words present in a text file “STORY.TXT”.
If the “STORY.TXT” contents are as follows:
My first book was Me and My Family. It gave me chance to be
Known to the world.
The output of the function should be:
Count of Me/My in file: 4
(ii)Differentiate between Web server and web browser. Write any two
popular web browsers
SECTION E (2 X 5 = 10 Marks)
36 Event Horizon Enterprises is an event planning organization. It is 5
planning to set up its India campus in Mumbai with its head office in
Delhi. The Mumbai campus will have four blocks/buildings - ADMIN,
FOOD, MEDIA,DECORATORS. You, as a network expert, need to
suggest the best network-related solutions for them to resolve the
issues/problems mentioned in points (I) to (V), keeping in mind the
distances between various blocks/buildings and other given
parameters.

Block to Block distances (in


Mtrs.) Number of computers
in each of the blocks/Center:
7

Distance of Delhi Head Office from


Mumbai Campus = 1500 km
(I) Suggest the most appropriate
location of the server inside the
MUMBAI campus. Justify your
choice.
(II) Which hardware device will you
suggest to connect all the
computers within each building?
(III) Draw the cable layout to efficiently connect various buildings
within the MUMBAI campus. Which cable would you suggest for
the most efficient data transfer over the network?
(IV) Is there a requirement of a repeater in the given cable layout?
Why/ Why not?
(V) What would be your recommendation for enabling live visual
communication between the Admin Office at the Mumbai campus
and the DELHI Head Office from the following options:
a) Video Conferencing b) Email c) Telephony
d) Instant Messaging
37 (i)Give two examples of PAN and LAN type of networks. 5
(ii)Which protocol helps us to browse through web pages using
internet browsers ?
(iii)Two universities in different states want to transfer information.
Which type of network do they need use for this.
(iv)What do you understand by the term network?
(v)How is IP address different from MAC address?

You might also like