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

Xii Comdec Set A

The document is an examination paper for Class XII Computer Science at OSDAV Public School, Kaithal, consisting of 35 questions divided into five sections with varying marks. It includes multiple-choice questions, coding exercises, SQL queries, and theoretical questions covering various topics in computer science. The total marks for the exam are 70, and it is designed to assess students' knowledge and skills in the subject.

Uploaded by

Sangeeta Garg
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)
148 views8 pages

Xii Comdec Set A

The document is an examination paper for Class XII Computer Science at OSDAV Public School, Kaithal, consisting of 35 questions divided into five sections with varying marks. It includes multiple-choice questions, coding exercises, SQL queries, and theoretical questions covering various topics in computer science. The total marks for the exam are 70, and it is designed to assess students' knowledge and skills in the subject.

Uploaded by

Sangeeta Garg
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

OSDAV Public School, Kaithal

December Examination (2024-25)


Class :XII
Subject :Computer Science SET-A
Time: 3 Hrs . M.M. : 70
General Instructions:-
● This question paper contains 35 questions.
● The paper is divided into 5 Sections- A, B, C, D and E.
● Section A consists of 18 questions (1 to 18). Each question carries 1 Mark.
● Section B consists of 7 questions (19 to 25). Each question carries 2 Marks.
● Section C consists of 3 questions (26 to 30). Each question carries 3 Marks.
● Section D consists of 4 questions (31 to 32). Each question carries 4 Marks.
● Section E consists of 2 questions (33 to 35). Each question carries 5 Marks.

Q No. Section-A (18 x 1 = 18 Marks) Marks

1. State True or False:


(1)
The Python interpreter handles syntax errors during code execution.

2. Identify the output of the following code snippet:


text = "PYTHONPROGRAM"
text=text.partition('PY')
print(text)
(1)
(A) (“PY”,”THON”,”PROGRAM”
(B) (“ “,”PY”,”,” THONPROGRAM”)
(C) [“ “,”PY”,”,” THONPROGRAM”]
(D) NONE

3. Which of the following expressions evaluates to TRUE?


(A) not(True) and False
(B) True or False (1)
(C) False and True
(D) True and not(TRUE)

4. What is the output of the expression?


country='International'
print(country.split("na"))
(A) ('Inter',”na”,”tional') (1)
(B) ('Inter',”na”,”tio”,”na”,”l')
(C) ['Inter', 'tio', 'l']
(D) ( 'Inter',” tio”,,” I”)

5. What will be the output of the following code snippet?


message= "World Peace" (1)
print(message[::-2])

6. What will be the output of the following code?


tuple1 = (1, 2, 3) (1)
tuple2 = (1, 2, 3)
print(tuple1 is tuple2)
(A) True (B)False (c)tuple1 (D)Error

XIIComp/Dec/ Set A Page 1|8


7. If my_dict is a dictionary as defined below, then which of the following
statements will raise an exception? (1)
my_dict = {'apple': 10, 'banana': 20, 'orange': 30}
(A) my_dict.get('orange')
(B) del(my_dict[”watermelon”])
(C) my_dict['apple']=20
(D) print(str(my_dict))

8. What does the list.remove(x) method do in Python?


(A) Removes the element at index x from the list (1)
(B) Removes the first occurrence of value x from the list
(C) Removes all occurrences of value x from the list
(D) Removes the last occurrence of value x from the list

State whether the following statement is True or False: (1)


9.
The finally block in Python is executed only if no exception
occurs in the try block.

10. 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()

11. What will be the output of the following code?


c = 10
def add():
global c
c = c + 2
print(c,end='#')
add() (1)
c=15
print(c,end='%')
(A) 12%15# (B) 15#12% (C) 12#15% (D) none

12. Which SQL command can change the degree of an existing relation? (1)

13. What will be the output of the query?


SELECT * FROM products WHERE product_name LIKE
'App%';
(A) Details of all products whose names start with 'App' (1)
(B) Details of all products whose names end with 'App'
(C) Names of all products whose names start with 'App'
(D) Names of all products whose names end with 'App'

14 In which datatype the value stored is padded with spaces to fit the specified
length.
(1)
(A) DATE (B)VARCHAR (C)FLOAT (D)CHAR

XIIComp/Dec/ Set A Page 2|8


15. Which network device is used to connect two networks that use different (1)
protocols?
(A) Modem (B)Gateway (C) Switch (D)Repeater
16. Which protocol is used to transfer files over the Internet? (1)
(A) HTTP (B)FTP (C)PPP (D)HTTPS

Q17 and Q18 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

17. Assertion (A): Positional arguments in Python functions must be passed in


the exact order in which they are defined in the function
signature. (1)
Reasoning (R): This is because Python functions automatically assign
default values to positional arguments.

18. Assertion (A): A SELECT command in SQL can have both WHERE and
HAVING clauses.
Reasoning (R): WHERE and HAVING clauses are used to check (1)
conditions, therefore, these can be used interchangeably.

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

19 How is a mutable object different from an immutable object in Python?


Identify one mutable object and one immutable object from the following: (2)
(1,2), [1,2], {1:1,2:2}, ‘123’

20. Observe the following code carefully and rewrite it after removing all
syntactical errors. Underline all the corrections made. (2)
def 1func():
a=input("Enter a number"))
if a>=33
print("Promoted to next class")
ELSE:
print("Repeat")
21 If L1=[1,2,3,2,1,2,4,2, . . . ], and L2=[10,20,30, . . .],
(2)
Then (Answer using builtin functions only)
A) Write a statement to sort the elements of list L1 in ascending order.
B) Write a statement to reverse the elements of list L2.
(2)
22 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='#')

XIIComp/Dec/ Set A Page 3|8


(A) W# (B) W#i#

(C) W#s# (D) W#i#s#

Predict the output of the following code


23.
d={"IND":"DEL","SRI":"COL","CHI":"BEI"}
str1=" "
for i in d:
str1=str1+str(d[i])+"@"
str2=str1[:-1] (2)
print(str2)

24. • What constraint should be applied on a table column so that duplicate


values are not allowed in that column, but NULL is allowed. (2)
• Write an SQL command to make the column M_ID the PrimaryKey of
an already existing table, named MOBILE.
(2)
25. Expand the term SMTP. What is the use of SMTP?
Marks
Q No. Section-C ( 3 x5 = 15 Marks)

Write a method SHOWLINES() in Python to read lines from text file (3)
26.
“TESTFILE.TXT‟ and display the lines which do not contain 'ke' and also do
not end with vowel.
Example: If the file content is as follows:
An apple a day keeps the doctor aside.
We all pray for everyone‟s safety.
A marked difference will come in our country.
The SHOWLINES() function should display the output as:
We all pray for everyone‟s safety.
OR
Write a function RainCount() in Python, which should read the content of a
text file “TESTFILE.TXT” and then count and display the count of occurrence
of independent word RAIN (case-insensitive) in the file.
Example: If the file content is as follows:
It rained yesterday
It might rain today
I wish it rains tomorrow too
I love Rain
The RainCount() function should display the output as: Rain -2
You have a stack named BooksStack that contains records of books. Each 3
27
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:
(I)push_book(BooksStack, new_book): This function takes the stack
BooksStack and a new book record new_book as arguments and

XIIComp/Dec/ Set A Page 4|8


pushes the new book record onto the stack.
(II)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".
Predict the output of the following code: 3
28 d = {"apple": 15, "banana": 7, "cherry": 9}
str1 = ""
for key in d:
str1 = str1 + str(d[key]) + "@" + “\n”
str2 = str1[::1]
print(str2)
OR
line=[4,9,12,6,20]
for I in line:
for j in range(1,I%5):
print(j,’#’,end=””)
print()
Write a function INDEX_LIST(S), where S is a string. The function returns 3
29 a list
named „indexList‟ that stores the indices of all vowels of S.
For example: If S is "Computer", then indexLIst should be [1,4,6]
3
30

(i) Add a primary key to a column name Vcode.


(ii) Increase the charges of all the cabs by 10%.
(iii) Delete all the cabs whose maker name is "Carus".
Section-D ( 2 x 4 = 8Marks) Marks
Q N.

31 Consider the table ORDERS as given below and Write the output

O_Id C_Name Product Quantity Price


1001 Jitendra Laptop 1 12000
1002 Mustafa Smartphone 2 10000
1003 Dhwani Headphone 1 1500
(A)Select c_name, sum(quantity) as total_quantityfrom orders group by
c_name;
(B)Select * from orders where product like%phone%';
(C) Select o_id, c_name, product, quantity, pricefrom orders where price between
1500 and 12000
D)Select max(price) from orders;.

XIIComp/Dec/ Set A Page 5|8


31. Or
Saman has been entrusted with the management of Law University Database.
He needs to access some information from FACULTY and COURSES tables
for a survey analysis. Help him extract the following information by writing the
desired SQL queries as mentioned below.
Table: FACULTY

(4)

A) To display complete details (from both the tables) of those Faculties


whose salary is less than 12000.
B) To display the details of courses whose fees is in the range of 20000to
50000 (both values included).
C) To increase the fees of all courses by 500 which have "Computer"in
their Course names.
D) (A) To display names (FName and LName) of faculty taking System
Design.
OR
(B) To display the Cartesian Product of these two tables.
A csv file "Happiness.csv" contains the data of a survey. Each record of thefile 4
32
contains the following data:
● Name of a country,Population of the country
● Sample Size (Number of persons who participated in the survey inthat
country)
● Happy (Number of persons who accepted that they were Happy)
For example, a sample record of the file may be:
[‘Signiland’, 5673000, 5000, 3426]
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 which the population is more than 5000000.
Count the number of records in the file.

XIIComp/Dec/ Set A Page 6|8


SECTION E ( 3x5=15 Marks) Marks
Q.N.
A table, named Shop, in sationary database, has the followingstructure: 5
33

Write the following Python function to perform the specified operation:


AddAndDisplay(): To input details of an item and store it in the table Shop.
The function should then retrieve and DELETE all recordsfrom the Shop
table where qty =35
Assume the following for Python-Database connectivity:Host: localhost, User:
root, Password: Pencil
Surya is a manager working in a recruitment agency. He needs to managethe 5
34
records of various candidates. For this, he wants the following information of
each candidate to be stored:
- Candidate_ID – integer
- Candidate_Name – string
- Designation – string
- Experience – float
You, as a programmer of the company, have been assigned to do this jobfor
Surya.

(I) Write a function to input the data of a candidate and append it in a binary
file.
(II)Write a function to update the data of candidates whose experienceis
more than 10 years and change their designation to "Senior Manager".

Event Horizon Enterprises is an event planning organization. It is planning to set 5


35
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 bestnetwork-related solutions for
them to resolve the issues/problemsmentioned in points (I) to (V), keeping in
mind the distances between various blocks/buildings and other given
parameters.

XIIComp/Dec/ Set A Page 7|8


(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) A) What would be your recommendation for enabling live visual
communication between the Admin Office at the Mumbai campusand
the DELHI Head Office from the following options:
a) Video Conferencing
b) Email
c) Telephony
d) Instant Messaging
OR
B) What type of network (PAN, LAN, MAN, or WAN) will be set up among the
computers connected in the MUMBAI campus?

XIIComp/Dec/ Set A Page 8|8

You might also like