Class 12 Cs QP 2nd Preboard
Class 12 Cs QP 2nd Preboard
2024-2025
CLASS XII
COMPUTER SCIENCE (083)
TIME: 03 HOURS M.M.: 70
General 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.
Page No. 1
(C) len(L)==5*len(S) (D)Can not be determined.
Given S=”0120131201010” (1)
5.
I=0
while S[0]==S[len(S)-I-1]:
S=S[1:-1]
print(S)
Which of the following statement(s) would give an error after executing? (1)
6.
Tup=(1,2,3,4) # Statement 1
print (Tup*2) # Statement 2
Tup+=(12,3) # Statement 3
Tup+=(1) # Statement 4
print(Tup) # Statement 5
(A) Statement 4,5 (B) Statement 3
(C)Statement 4 (D) Statement 3 and 4
7. Consider the dictionary D: D={1:11,2:22,3:33,4:44,5:55} (1)
What will be the output of statements?
print(sum(D))
print(len(D))
(A) Error and 5 (B)165 and Error
(C)15 and Error (D)15 and 5
Given T=(1,(2,(3,(4),5),6),7), What would print(len(T)) (1)
8.
return?
(A) 3 (B)5
(C) 4 (D)7
Which of these is not true about keys in database?
9. (1)
(A) The primary key field should be unique and Not Null.
(B) There can be only one foreign key in the table.
(C) Foreign key can be Null.
(D) Primary key is chosen from the candidate keys.
Given the following statements in the context of binary files: (1)
10.
1. There is no delimiter to end a line.
2. Since they are directly in the form of binary, hence there is no need to
translate them
3. We can open some binary files in the normal text editor but we cannot
read the content present inside the file.
4. Once the record is created, it is appended to the binary file using the
Page No. 2
dump() method, which writes the object onto the opened file.
5. To read the contents from binary use load() method of pickle module
(A) Only 2,4 are correct (B) 1,2,3,4 are correct
(C)1,2,4,5 are correct (D)1,2,3,5 are correct.
11. State True or False: There can be only one except block for a try block. (1)
12. What will be the output of given code? (1)
count = 5
def increment():
count = 10
count += 1
print(count,end=”%”)
def decrement():
global count
count=10
count-=1
print(count,end=”%”)
increment()
decrement()
print( count)
(A) 11%9%5 (B) 11%9%9
(C) 11%9%10 (D) 11%10%9
13. Which command can be used to find cardinality of a table in SQL? (1)
14. In SQL, if the where clause in select command has the condition name like ‘_ (1)
%B%” then, out of the given names which will be there in the output?
1. BRIJESH 4. BHASKAR
2. ABHISHEKH 5.BINAY
3. PRABHAT 6.SOHAIB
(A) Only 1,4 and 5 (B) Only 2,3 and 6
(C) Only 2 (D) All
15. What is the default length of char data type? (1)
(A) 1 (B)255 (C)8 (D)0
16. Which of the following SQL clauses is used to fetch unique values from a (1)
column?
(A) Group By (B)Unique (C)Distinct
(D)Having
17. Which of these is used for sending emails? (1)
Page No. 3
(A) HTTP (B) FTP (C)SMTP (D) IP
18. Name the device that connects similar networks:
(1)
(A) Modem (B) Gateway (C)Bridge (D) HUB
19. Name the topology in which If the central hub fails, all communication (1)
between connected devices is disrupted.
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: If a value mutable datatype is passed to a function the changes (1)
are reflected in the value outside the function also.
Reasoning: This is because mutable data types are passed by reference,
meaning the function receives a reference to the same memory location of
the original object rather than a copy of the object.
21. Assertion: In a select query we can test multiple conditions. (1)
Reasoning: For each condition a separate where clause is required.
Q No Section-B ( 7 x 2=14 Marks) Marks
22. Which of the following is/are not a valid key value pair(s) in the given dictionary?(2)
Dict={“A”:5,1:44,[2,5]:[6,7],(3,4):[3,4]}
Also, state the reason for the same.
23. Give two examples of each of the following: (2)
(A) Logical expressions (B)Arithmetic Expression.
24. Given a dictionary d={1:1,2:2,3:3,4:4},Write built-in functions to: (2)
(A) Remove the last element from the dictionary.
(B) To display value at key=2
25. Given the following program which of these can be the possible output(s)? (2)
import random
str="Preboard2024”
Rindex=random.randint(0,len(str))
print(Rindex)
for i in range(0,Rindex,2):
print(str[i]*2,end=" ")
(A) PP (B) PP ee oo
(C) PP rr ee (D) PP bb rr
26. Find the error in the given code: (2)
Page No. 4
numbers = [1, 2, 3, 4, 5]
squares = []
if len(numbers) > 0
for num in numbers:
square = num ** 2
squares.append(square)
Print("The squared numbers are: ",squares)
elif:
print("The list is empty’)
27. I Write name of the constraint to ensure that field age does not exceed
17.
OR
II
Write name of the constraint to ensure that age field is having value 17
if no age is given.
Write an SQL command to add a field Blood_group to employee table
which can not be left blank or set NULL.
OR
Write an SQL command to make the rename the field mname to
Mother_name
in Employee table.
28. How is Bus topology different from Star topology? Give two points. (2)
OR
Expand the term FTP. Also, give its definition.
Q No. Section-C ( 3 x 3 = 9 Marks) Marks
29. Write a Python function find5() that displays all the lines having more than 5 (3)
words from a text file named “prep.txt”.
OR
Write a Python function findvowel() that finds and displays all the words
starting with a vowel.
30. A list named items contains details of items available in a stationery shop. (3)
Each item is represented as a list in the form [Item_name, Price, Quantity].
Write the following user-defined functions to perform operations on a stack
named Shop:
(A) Push_item(): Push an item onto the stack if its price is greater than
50.
(B) Pop_item(): Pop the top item from the stack and display it. Also,
Page No. 5
display "Underflow" if there are no items in the stack.
(C) Peep():To display the item at top of the stack.
OR
(A) Write the definition of a user-defined function `push (N)` which accepts
a list of strings in a parameter `N` and pushes the strings starting with
capital letters.
(B) Write function pop() to pop the topmost string from the stack and
returns its length. If the stack is already empty, the function should
display "Empty".
(C) Write function Disp() to display all element of the stack. If the stack is
empty, the function should display 'None'.
31. Predict the output of the Python code given below: (3)
def short_sub(lst,n) :
for i in range(0,n) :
if i<n:
lst[i]=lst[i]+lst[i]
else:
lst[i]=lst[i]*len(lst[i])
subject=['CHEMISTRY', 'HINDI', 'PHYSICS', 'CS', 'MATHS']
x=len(subject)
short_sub(subject,x)
print(subject)
OR
s=”Cbse Examination 2022-2023”
num=2020
n=""
sum=num
for i in s:
if i.isdigit():
n+=i
for i in n:
sum+=int(i)
print(sum)
Q No. Section-D ( 4 x 4 = 16 Marks) Marks
Table: Personal (4)
32. P_ID Name Designation Salary Allowance
P01 Rohit Manager 89000 4800
Page No. 6
P02 Kashish Clerk NULL 1600
P03 Mahesh Superviser 48000 NULL
P04 Salil Clerk 31000 1900
P05 Ravina Superviser NULL 2100
Consider the table Personal given below:
Page No. 7
T02 103 2000 Debit 12-05-2017
T03 102 3000 Credit 10-06-2017
T04 103 12000 Credit 12-09-2017
T05 101 1000 Debit 05-09-2017
Table :Customer
CNO CNAME ADDRESS
101 Richa Jain Delhi
102 Surbhi Sinha Chennai
103 Lisa Thomas Bangalore
104 Imran Ali Delhi
105 Roshan Singh Chennai
(A) Distance between various blocks Suggest the most suitable place to
Building Distance
Building 1 to Building 3 120 m Number of computers
Building 1 to Building 2 50 m Building Number of Computers
Building 2 to Building 3 65 m Building 1 25
Noida Branch to Head 1500 km Building 2 51
Office Building 3 150
Head Office 10
install the server for this organization.
Also, give reason to justify your suggested location.
(B) Suggest the cable layout of connections between the buildings inside the
campus.
(C) Suggest the placement of the following devices with justification:
i)Switch ii) Repeater
(D) The organization is planning to provide a high-speed link with the head
office situated in Bengaluru, using a wired connection. Suggest a suitable
wired medium for the same.
(E) The System Administrator does remote login to any PC, if any
Page No. 9
requirement arises. Name the protocol, which is used for the same.
Page No. 10