CLASS XII CS PRE BOARD QP

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

SET -1

Roll Number
Candidates must write the Set No on
the title page of the answer book

DAV PUBLIC SCHOOLS, ODISHA


PRE BOARD EXAMINATION – I, 2024-25

 Please check that this question paper contains 09 printed pages.


 Set number given on the right hand side of the question paper should be written on the title page of the
answer book by the candidate.
• Check that this question paper contains 37 questions.
 Write IX
CLASS- down the Serial Number of the question in the left side of the margin before attempting it.
 15 minutes time has been allotted to read this question paper. The question paper will be distributed 15
minutes prior to the commencement of the examination. The students will read the question paper only
and will not write any answer on the answer script during this period.

CLASS – XII
SUB: COMPUTER SCIENCE (083)
Max. Marks:70 Time Allowed: 3 Hours
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.

SECTION-A (21x1=21 Marks)


1. What is the output of the following code: T=(200) [1]
print(T*2)
(a) (200,200) (b) Error (c) 400 (d) [200,200]
2. Which of the following is not a DDL command in SQL ? [1]
(a) DROP (b) CREATE (c) UPDATE (d) ALTER
3. Which of the following functions cannot be used with a tuple? [1]
(a) max() (b) sort (c) count (d) sorted
4. What will list1.extend([4, 5]) do if list1 = [1, 2, 3]? [1]
(a) max() (b) sort (c) count (d) sorted
5. The SELECT statement when combined with ___ clause, returns records without repetition. [1]
(a) DISTINCT (b) DESCRIBE (c) UNIQUE (d) NULL
6. What output will be produced by the following expression? print ((2+3) *5/4+(4+6)//2) [1]
(a) 11.0 (b) 11.25 (c) 11 (d) 11.5
7. Which of the following network devices amplify the incoming signal and forwards it in LAN? [1]
(a) Repeater (b) Gateway (c) Router (d) Modem

PB/CS - XII Page 1 of 9


8. State whether the following statement is True or False: [1]
While writing a program all exceptions must be handled as the system cannot handle Exceptions on it’s
own.
9. Which out of the following Network devices is used to connect dissimilar networks (different protocols)? [1]
(a) Hub (b) Router (c) Bridge (d) Gateway
10. What will be the output of the following code? import random [1]
List=["Delhi","Mumbai","Chennai","Kolkata"]
for y in range(4):
x=random.randint(1,3)
print(List[x],end="#")
(a) Delhi#Mumbai#Chennai#Kolkata# (b) Mumbai#Chennai#Kolkata#Mumbai#
(c) Mumbai#Mumbai#Mumbai#Delhi# (d) Mumbai#Mumbai#Chennai#Mumbai
11. Write the output of the following code? [1]
t=(100, 200, 300,[560, 780], 900)
t[3][-1]=[400, 500]
print(t)
12. If cross product is done on two tables Table1(2 tuples and 3 attributes) and Table2 [1]
(2 attributes and 3 tuples) then what will be the cardinality of the resultant table?
13. Select the correct output of the code: [1]
quote= "Mission Chandrayan-3"
a=quote.split( "a" )
print(a[0],"++",a[3])
(a) Mission Ch++3 (b) Mission Ch++ndrayan-3
(c) Mission Ch++yan-3 (d) Mission Ch++n-3
14. Which of the following is a valid identifier in Python? [1]
(a) False (b) var- (c) 15CBSE (d) sahodaya1
15. Fill in the blank: [1]
_________command is used to remove a column from a table in SQL.
(a) update (b) remove (c) alter (d) Delete
16. Fill in the blank: [1]
The statement when combined with table name returns the structure of the table.
(a) DESC (b) UNIQUE (c) DISTINCT (d) NULL
Q 17 and 18 are ASSERTION AND REASONING based questions. Mark the correct choice as [2]
(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) : A function is a block of organized and reusable code that is used to perform a single,
related action.
Reason (R) : Function provides better modularity for your application and a high degree of code
reusability.
18. Assertion (A) : CSV(Comma Separated Values) is a file format for data storage which looks like a text
file.
Reason(R) : The information is organized with one record on each line and each field is separated by
comma.

PB/CS - XII Page 2 of 9


19. Assertion (A): Positional arguments in Python functions must be passed in the exact order in which they
are defined in the function signature.
Reasoning (R): This is because Python functions automatically assign default values to positional
arguments.
20. Which protocol is used to transfer files over the Internet?
(a) HTTP (b) FTP (c) PPP (d)HTTPS
21. Which aggregate function can be used to find the cardinality of a table?
(a) sum() (b) count() (c)avg() (d)max()

SECTION-B (7x2=14 Marks)


22. Given is a Python string declaration: [2]
S="Digital India @@ 2023"
Write the output of:
print(S.replace('2','2+1'))
print(S[::-2])
23. What will be the output of the following Python code? [2]
def Findoutput():
L="Program"
X=""
L1=[]
count=1
for i in L:
if i in ['a','e','i','o','u']:
X=X+i.upper()
else:
if count%2 != 0:
X=X+str(len(L[:count]))
else:
X=X+i
count=count+1
print(X)
Findoutput()
OR
What will be the output of the following Python code?
def Display(str):
m=""
for i in range(0,len(str)):
if(str[i].isupper()):
m=m+str[i].lower()
elif str[i].islower():
m=m+str[i].upper()
else:
if i%2!=0:
m=m+str[i-1]
else:
m=m+"$"
print(m)
Display('Python3.10')

PB/CS - XII Page 3 of 9


24. Rewrite the following code in Python after removing all syntax error(s). Underline each correction done
in the code. [2]
value=30
for res in Range(0,value):

If res%4==0:
print(res*4)
elseif
res%5==0:
print(res+3)
Else:
print(res+10)

25. Write the Python statement for each of the following tasks using BUILT-IN functions/methods only: [2]
(a) Sort the elements of a tuple Tup in ascending order.
(b) Remove an element present at index 3 of a List Li.
OR
(a) Convert the input to the type of element as entered.
(b) Find the total of values in a list of integers.
26. Write the output of the following code snippet. [2]
V=70
def display(N):
global V
V=35
if N%9==0:
V=V*N
else:
V=V/N
print(V, end="*")
display(15)
print(int(V))
27. Arjun has created a table SMS containing SRoll_no, Sname, SClass, SPhone_no and percent. Later, he
realizes that the field Sphone_no may have duplicate values. Help him to write a SQL command to set
the property of this field to deny duplicate values. Also he needs help to write SQL command to see the
structural detail of the table SMS. [2]
OR

Ms. Trisha of a software company created a table Clients under a database Company. After creating
table, she now wants to add an additional column C Portfolio to store textual information containing
maximum of 100 characters and that can’t be blank. Also she wants to view all the tables present under
the database Company. Help her to write the SQL commands to complete the above tasks.

PB/CS - XII Page 4 of 9


28. (a) Expand the following terms: IMAP, SMTP [2]
(b) Give one difference between LAN and WAN.
OR
(a) Define the term Telnet with respect to networks.
(b) How is server different from client?
SECTION-C (3x3=9 Marks)
29. Write a function Rev_Text() to read a text file “Story.txt“ and Print the word(s)starting with ‘I’ in
reverse order, rest of the words will be printed as it is. [3]
Example: If content of the text file is : INDIA IS MY COUNTRY
Output will be: AIDNI SI MY COUNTRY
OR
Write a function countmy() in Python to read the text file “Data.txt” and count the number of times
“my” or “My” occurs in the file.
For example if the file “Data.txt” contains:
“This is my website. I have displayed my preferences in the CHOICE section.” The countmy( ) function
should display the output as: my occurs 2 times.
30. Predict the output of the following code: [3]
Str="CBSE_2050"
New_str=" "
for i in range(len(Str)):
if i%2==0:
New_str=New_str+Str[i-1]
elif(Str[i].isupper()):
New_str=New_str+Str[i].lower()
else:
New_str=New_str+"#"
print("The New string:",New_str)
OR
d = {15:"apple",7:"banana",9:"cherry"}
str1 = ""
for key in d:
str1 = str1 + str(d[key]) + "@" + '\n'
str2 = str1[:-1]
print(str2)

31. A list contains following record of a ‘Computerʼ : [MACAddress, Brand, Price, RAM] [3]

Write separate user defined functions to perform given operations on the stack named ‘System’:
(i) Push_element() – To Push an object containing Brand and Price of computers whose RAM
capacity is more than 8 GB.

(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:

PB/CS - XII Page 5 of 9


If the lists of computer details are:

[“M001”, “Lenovo”, 5000, 16]


[“M002”, “HP”, 72000, 8]
[“M003”, ”Apple”, 110000, 16]
[“M004”, “Compaq”, 50000,4]
The stack should contain
[“Lenovo” ,75000]
[”Apple”, 110000]

The output should be:


[“Lenovo”, 75000]
[”Apple”, 110000]
Stack Empty

OR

BCCI has created a dictionary containing top players and their runs as key value pairs of cricket team. Write
a program, with separate user defined functions to perform the following operations:
● Push the keys (name of the players) of the dictionary into a stack, where the corresponding value
(runs) is greater than 49.
● Pop and display the content of the stack. For example:

If the sample content of the dictionary is as follows:


SCORE={"KAPIL":40,"SACHIN":55,"SAURAV":80,"RAHUL":35,"YUVRAJ":110}
The output from the program should be: YUVRAJ SAURAV SACHIN

SECTION-D
32. (a) Refer the tables given below: [4]
Table : Book
Code Sub
B1 English
B2 Physics
B3 History
B4 Science

Table : Stock
SCode Pub Qty Code
P01 Gyan Chand 250 B1
P02 Pustak House 340 B2
P03 Arora 470 B3
P04 Sonka 245 B5
Predict the output for the following query:
SELECT * FROM Book NATURAL JOIN Stock;

PB/CS - XII Page 6 of 9


(b )Consider the following tables WORKER and PAYLEVEL and write the output of the following
SQL queries (i) to (iv).
Table : WORKER
ECODE NAME DESIGN PLEVEL DOJ DOB
11 Radhe Shyam Supervisor P001 13-Sep-2004 23-Aug-1981
12 Chander Nath Operator P003 22-Feb-2010 12-Jul-1987
13 Fizza Operator P003 14-Jun-2004 14-Oct-1983
15 Ameen Ahmed Mechanic P002 21-Aug-2006 13-Mar-1984
18 Sanya Clerk P002 19-Dec-2005 09-Jun-1987

Table : PAYLEVEL
PLEVEL PAY ALLOWANCE
P001 26000 12000
P002 22000 10000
P003 12000 600

(i) SELECT COUNT(PLEVEL), PLEVEL FROM WORKER GROUP BY PLEVEL;


(ii) SELECT MAX(DOB), MIN(DOJ) FROM WORKER;
(iii) SELECT NAME, PAY FROM WORKER W,PAYLEVEL P WHERE W. PLEVEL= P. PLEVEL
AND W.ECODE <13;
(iv) SELECT PLEVEL, PAY+ALLOWANCE FROM PAYLEVEL WHERE PLEVEL= ‘P003’;
(c) Write SQL Command to delete a table from database.
33. Sunil wants to write a program in Python to update the quantity to 20 of the records whose item code is
111 in the table named shop in MySQL database named Keeper.
The table shop in MySQL contains the following attributes: [4]
● Item_code: Item code (Integer)
● Item_name: Name of item (String)
● Qty: Quantity of item (Integer)
● Price: Price of item (Integer)
Consider the following to establish connectivity between Python and MySQL:
Username: admin Password : Shopping Host: localhost
34. Consider the following tables ITEM and CUSTOMER, write SQL commands for the statements (a) to (d)
[1x4=4]
TABLE : ITEM
I_ID Item_Name Manufacturer Price
PC01 Personal Computer ABC 35000
LC05 Laptop ABC 55000
PC03 Personal Computer XYZ 32000
PC06 Personal Computer MNO 37000
LC03 Laptop PQR 57000

PB/CS - XII Page 7 of 9


TABLE : CUSTOMER
C_ID Customer_Name City I_ID
01 N Roy Delhi LC03
06 H Singh Mumbai PC03
12 R Pandey Delhi PC06
15 C Sharma Delhi LC03
16 K Agrawal Bangalore PC01
(a) To display the details of those Customers whose city is Delhi.
(b) To display the details of Items whose Price is not in the range of 35000 to 55000
(Both values included).
(c) To display the Customer_Name, City from table CUSTOMER and Item_Name and Price
from table ITEM, with their corresponding matching I_ID.
(d) To increase the Price of all items by 1000 in the table ITEM.
35. Sangeeta is a Python programmer working in a computer hardware company. She has to maintain the
records of the peripheral devices. She created a csv file named Peripheral.csv, to store the details.
The structure of Peripheral.csv is: [P_id, P_name, Price]
where P_id is Peripheral device ID (integer)
P_name is Peripheral device name (String)
Price is Peripheral device price (integer)
Sangeeta wants to write the following user defined functions :
Add_Device() : to accept a record from the user and add it to a csv file, Peripheral.csv
Count_Device() : To count and display number of peripheral devices whose price is less than 1000.

SECTION-E
36. Quickdev, an IT based firm, located in Delhi is planning to set up a network for its four branches
within a city with its Marketing department in Kanpur.
As a network professional, give solutions to the questions (i) to (v), after going through the branches
locations and other details which are given below: [1x5=5]

PB/CS - XII Page 8 of 9


Answer the following questions based on the above information
(a) Suggest the most suitable place to install the server for the Delhi branch with a suitable reason..
(b) Suggest an ideal layout for connecting all these branches within Delhi..
(c) Which device will you suggest, that should be placed in each of these branches to efficiently
connect all the computers within these branches ?
(d) Delhi firm is planning to connect to its Marketing department in Kanpur which is approximately 300
km away. Which type of network out of LAN, WAN or MAN will be formed ? Justify your answer.
(e) Suggest a protocol that shall be needed to provide help for transferring of files between Delhi and
Kanpur branch.
37. (a) Write any two differences between Text file and Binary file. [2+3=5]
(b) Write a function in python to search and display details, whose destination is “Cochin” from
binary file “Bus.dat”. Assuming the binary file is containing the following elements in the list:
* Bus Number
* Bus Starting Point
*Bus Destination
OR
(a) Write any two differences between ‘rb’ and ‘ab’ modes in Binary files.
(b) A binary file “salary.dat” has structure [employee id, employee name, salary].
Write a function CountRec() in Python that would read contents of the file “salary.dat” and display
the details of those employee whose salary is above 20000.

******

PB/CS - XII Page 9 of 9

You might also like