[go: up one dir, main page]

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

Sample paper-UT2

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)
414 views7 pages

Sample paper-UT2

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

SRI SRI RAVISHANKAR VIDYA MANDIR

BANGALORE EAST
UNIT TEST-2 Practice Paper 2024– 2025
Name: Date:
Subject: Computer Science Class: XII
Duration: 3 hours Max.Marks:70

General Instructions:
1. This question paper contains 37 questions.
2. All questions are compulsory.
3. The paper is divided into 5 Sections- A, B, C, D and E.
4. Section A, consists of 21 questions (1 to 21). Each question carries 1 Mark.
5. Section B, consists of 7 questions (22 to 28). Each question carries 2 Marks.
6. Section C, consists of 3 questions (29 to 31). Each question carries 3 Marks.
7. Section D, consists of 4 questions (32 to 35). Each question carries 4 Marks.
8. Section E, consists of 2 questions (36 to 37). Each question carries 5 Marks.
9. All programming questions are to be answered using Python Language only.
10. In case of MCQ, text of the correct answer should also be written.

Ques SECTION – A (21 x 1 = 21) Mar


tion ks
No. Allo
cat
ed
1. What will be the output of the following code? 1
a = 15
def update(x):
global a
a += 2
if x%2==0:
a *= x
else:
a //= x
a=a+5
print(a, end="$")
update(5)
print(a)
A. 20$11
B. 15$4
C. 20$4
D. 22$4
2. What will be the output of the following code? 1
n = 25
def test(n):
n += 5
print(n, end=' ')
n -= 5
print(n,end=' ')
test(10)
print(n, end=' ')
A. 25 20 25
B. 15 10 25
C. 25 20 10
D. 15 10 10
3. Which of the following statements can terminate execution of a function in 1
python?
A. exit
B. return
C. break
D. All of the above

4. Which of the following is not true for keyword arguments? 1


A. Keyword arguments can be specified in any order.
B. Only those parameter names which are defined in function header can
be used as keywords while specifying keyword arguments
C. A positional argument can follow a keyword argument in a function call
D. Both a and c

5. State True/False 1
file mode is mandatory argument for open() function.
6. __________ files are stored in a computer in a sequence of bytes. 1
(A) Text
(B) Binary
(C) CSV
(D) Notepad
7. Dima is trying to read a list l1 from a binary file ‘num’. Consider the 1
following code written by her.
import pickle
f1 = open("num",'rb')
l1=__________________#Statement 1
print(l1)
f1.close()
Identify the missing code in Statement 1.
A. pickle.load(f1)
B. pickle.load(l1,f1)
C. pickle.read(f1)
D. pickle.dump(l1,f1)
8. Consider the following directory structure. 1
What will be the absolute path of infrastructure?
(a) Final\Infrastructure
(b) D:\Data\Final\Infrastructure
(c) ..\Final\Infrastructure
(d)..\Shapefiles\Final\Infrastructure
9. A text file is opened using the statement f = open(‘story.txt’). The file has a 1
total of 10 lines. Which of the following options will be true if statement 1 and
statement 2 are executed in order.
Statement 1: L1 = f.readline( )
Statement 2: L2 = f.readlines( )
A. L1 will be a list with one element and L2 will be list with 9 elements.
B. L1 will be a string and L2 will be a list with 10 elements.
C. L1 will be a string and L2 will be a list with 9 elements.
D. L1 will be a list with 10 elements and L2 will be an empty list.

10. ______ condition will arise, if a user tries to pop an empty stack. 1

11. Inspecting the value at the stack’s top without removing it is 1


________
(a) peek operation (b) insert operation
(c) pop operation (d) push operation
12. What happens if an exception is raised inside the finally block in Python? 1
(A)The exception is suppressed
(B) The program terminates with an error message
(C) The program continues executing normally
(D) The exception is re-raised

13. Which of the following statements is false? 1


(A)A try-except block can have more than one except statement
(B) One block of except statement cannot handle multiple exceptions
(C) The finally block is always executed
(D)When 1 == "1" is executed, no exception is raised

14. _______cables carry’s the data signals in the form of light. 1

15. A set of rules that need to be followed by the communicating parties in order 1
to have successful and reliable data communication is called ____.

16. Which of the following is not correct about the switch 1


(A)It is an intelligent HUB
(B) It sends signal only to the intended node
(C) It cannot forward multiple packets at the same time
(D)It helps to connect multiple computers
17. Which of the following is transmission medium for TV remotes? 1
(a) Infrared (b) Coaxial cable (c) Bluetooth (d)Microwave
18. ________cable consists of an inner copper core and a second conducting outer 1
sheath.
A) Twisted-pair B) Shielded twisted-pair
C) Coaxial D) Fiber-optic
19. Name the network which was only used for academic purpose. 1
(A) NSFNET (B) ARPANET (C) INTRANET (D)INTERNE
Q17 and Q18 are ASSERTION AND REASONING 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): If numeric data are to be written to a text file, the data needs to 1
be converted into a string before writing to the file.
Reason (R): write() method takes a string as an argument and writes it to the
text file.

21. Assertion (A): If a text file already containing some text is opened in write 1
mode the previous contents are overwritten.
Reasoning (R): When a file is opened in write mode the file pointer is present
at the beginning position of the file.

SECTION-B ( 7 x 2 = 14 )

22. How can a function return multiple values? Illustrate with an example 1+1
program.

23. Rewrite the code after correcting it and underline the corrections. 2
Def swap(d):
n={}
values = d.values()
keys = list(d.keys[])
k=0
for i in values
n(i) = keys[k]
k=+1
return n
result = swap({‘a’:1,’b’:2,’c’:3})
print(result)

24. Suppose the context of “Rhymes.txt” is 2


Hickory Dickory Dock
The mouse went up the clock

What will be the output of the following Python code?


f=open(“Rhymes.txt”)
l=f.readlines()
x=["the","ock"]
for i in l:
for w in i.split():
if w in x:
print(w,end="*")

25. Differentiate between fruitful and non-fruitful function with the help of an 2
example.
26. What are the benefits of Exception Handling. 2
27. (i) Expand the following terms : URL, XML 1+1
(ii) Give one difference between HTTP and FTP.
28. (i) Define the term IP address with respect to network. 1+1
(ii) What is the main purpose of a Router?
SECTION-C ( 3 x 3 = 9 )

29. Write the definition of a method/function SearchOut(Teachers, TName) to 3


search for TName from a list Teachers, and display the position of its
presence.
For example :
If the Teachers contain ["Ankit", "Siddharth", "Rahul", "Sangeeta", "rahul"]
and TName contains "Rahul"
The function should display
Rahul at 2
rahul at 4
30. Write a method/function COUNTLINES() in Python to read lines from a text 1+2
file CONTENT.TXT, and display those lines, which have @ anywhere in the
line.

31. A dictionary, d_city contains the records in the following format : {state:city} 3
Define the following functions with the given specifications :
(i) push_city(d_city): It takes the dictionary as an argument and pushes all the
cities in the stack CITY whose states are of more than 4 characters.
(ii) pop_city(): This function pops the cities and displays "Stack empty" when
there are no more cities in the stack.

SECTION-D ( 4 x 4 = 16 )
32. (i) When is EOFError exception raised in python? 1+3

(ii) Give an example code to handle EOFError? The code should display the
message "No more objects to read" in case of EOFError exception, and the
message "Some error occurred" in case of any other exception.

33. Mr. Mahesh is a Python Programmer working in a school. He has to maintain 4


the records of the sports students. He has created a csv file named sports.csv,
to store the details. The structure of sports.csv is :
[sport_id, competition, prize_won]
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_detail(): to accept the detail of a student and add to a csv file,
“sports.csv".
Count_Medal(): to display the name of competitions in which students have
won "Gold" medal.
Help him in writing the code of both the functions.

34. (i) Give one difference between write() and writeline() function in text 1+3
file.
(ii) Write a method/function COUNTWORDS() in Python to read
contents from a text file DECODE.TXT, to count and return the
occurrence of those words, which are having 5 or more characters
and at least one digit in it.

35. (i) Give any two characteristics of stacks. 2+2


(ii) Predict the output of the following code :
def Total (Num=10):
Sum=0
for C in range(1,Num+1):
if C%2!=0:
continue
Sum+=C
return Sum
print(Total(4),end="$")
print(Total(),sep="@")

SECTION-E ( 2 x 5 =10 )
36. (i) What is the main purpose of seek() and tell() method ? 1+4
(ii) A binary file “Items.dat” has structure as [Code, Description, Price].
Write a function UpdateRec(Code) in Python which will accept the code as
parameter and update the price of that by 5%. Also display an appropriate
message if there is no record matching for that particular Code in the file.
37. Logistic Technologies Ltd. is a Delhi based organization which is expanding 5
its office set-up to Ambala. At Ambala office campus, they are planning to
have 3 different blocks for HR, Accounts and Logistics related work. Each
block has a number of computers, which are required to be connected to a
network for communication, data and resource sharing.

As a network consultant, you have to suggest the best network related


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

(i) Suggest the most appropriate block/location to house the SERVER in the
Ambala office. Justify your answer.
(ii) Suggest the best wired medium to efficiently connect various blocks within
the Ambala office compound.
(iii) Draw an ideal cable layout (Block to Block) for connecting these blocks
for wired connectivity.
(iv) The company wants to schedule an online conference between the
managers of Delhi and Ambala offices. Which protocol will be used for
effective voice communication over the Internet?
(v) Which kind of network will it be between Delhi office and Ambala office ?

You might also like