0% found this document useful (0 votes)
57 views

COMP.SC - QP - [SET - 1]-1

Uploaded by

Satya Jit Sahoo
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)
57 views

COMP.SC - QP - [SET - 1]-1

Uploaded by

Satya Jit Sahoo
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/ 15

SET - 1

KALINGA ENGLISH MEDIUM SCHOOL,KALARABANK

PRE-BOARD EXAMINATION (2024-25)

• Please check that this question paper contains 15 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 35 questions.
• Write 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. Students should not write anything in the question paper.

CLASS- XII
SUB : COMPUTER SCIENCE (083)
Time Allowed: 3 hours Maximum Marks: 70
General Instructions :-

1. Please check this question paper contains 35 questions.


2. All questions are compulsory.
3. This question paper is divided into 5 sections- A, B, C, D and E.
4. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
5. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
6. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
7. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
8. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
9. All programming questions are to be answered using Python Language only.

Page 1 of 15
SECTION-A

1. Which of the following is an invalid identifier in Python? 1


(a) 2ndclass (b) NONE
(c) FLOAT (d) Income_Tax
2. What is the output of the following code? 1
T=(200)
print(T*2)
(a) (200,200) (b) Error
(c) 400 (d) [200,200]

3. What will be the output of the following statement? 1


print (int(“4”+ “9”)+10)
(a) 23 (b) “4910” (c) “23” (d) 59
4. Which out of the following Network devices is used to connect 1
dissimilar networks (different protocols)?
(a) Hub (b) Router
(c) Bridge (d) Gateway
5. 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
6. Given a Tuple tup1= (10, 20, 30, 40, 50, 60, 70, 80, 90) 1
What will be the output of print (tup1 [3:7:2])?
(a) (40,50,60,70,80) (b) (40,50,60,70)
(c) [40,60] (d) (40,60)
7. 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.

Page 2 of 15
8. What will be the output of the following code? 1
L1, L2 = [10, 15, 20, 25], []
for i in range(len(L1)) :
L2. insert( i,L1.pop())
print (L1, L2,sep="&")
(a) [ ]&[25, 20, 15, 10]
(b) [10, 15, 20, 25]&[25, 20, 15, 10]
(c) [10, 15, 20, 25]&[10, 15, 20, 25]
(d) [25, 20, 15, 10]&[]

9. 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
10. 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
11. Which of the following network devices amplify the incoming signal 1
and forwards it in LAN?
(a) Repeater (b) Gateway
(c) Router (d) Modem

12. Select the correct output of the code: 1


str=“computer is fun”
p=len(str)
substr=“fun”
print(str.find(substr, 0, p))
(a) 13 (b) 12 (c) -1 (d) 0

Page 3 of 15
13. What will be the output of the following code? 1
import random
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

14. Which of the following functions can not be used with a tuple? 1
(a) max( ) (b) sort
(c) count (d) sorted
15. When is the finally block executed? 1
(a) When there is no exception
(b) When there is an exception
(c) Only if some condition that has been specified is satisfied
(d) Always

16. If cross product is done on two tables Table1 (2 tuples and 3 attributes) 1
and Table2 (2 attributes and 3 tuples) then what will be the cardinality
of the resultant table?
Q17 and 18 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
17. Assertion (A) : A function is a block of organized and reusable 1
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 1


for data storage which looks like a text file.

Page 4 of 15
Reason (R) : The information is organized with one record on
each line and each field is separated by comma.

SECTION-B

19. Rewrite the following code in Python after removing all syntax error(s). 2
Underline each correction done in the code.
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)

20. (a) Expand the following terms: 2


IMAP, GSM
(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?
21. (a) Given is a Python string declaration: 1+1=2
myexam="Aditya-L1"
Write the output of:
print( myexam[ 4 : -4 ] )

(b) Write the output of the code given below:


my_dict = {"name": "Aman", "age": 26}
my_dict['age']=27
my_dict['address'] = "Delhi"
print(my_dict.items())

22. Arjun has created a table SMS containing SRoll_no, Sname, SClass, 2
SPhone_no and percent. Later, he realizes that the field Sphone_no may

Page 5 of 15
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.
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 CPortfolio 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.
23. Predict the output of the Python code given below: 2
def fun(s):
n = len(s)
m=''
for i in range(0, n):
if (s[i] >= 'a' and s[i] <= 'm'):
m = m + s[i].upper()
elif (s[i] >= 'n' and s[i] <= 'z'):
m = m + s[i-1]
elif (s[i].isupper()):
m = m + s[i].lower()
else:
m = m + '#'
print(m)
fun('Gini%Jony')
OR
Predict the output of the Python code given below:
def fun():
frequency = { }
list = ['a','b','c','a','c']
for index in list:
if index in frequency:
frequency[index]+=1
else:

Page 6 of 15
frequency[index]=1
print(len(frequency))
print(frequency)
fun()
24. Write the Python statement for each of the following tasks using BUILT- 2
IN functions/methods only:
(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.
25. Write the output of the following code snippet.
V=70 2
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))

SECTION-C
26. (a) Refer the tables given below: 3
Table: Book
Code Sub
B1 English
B2 Physics
B3 History
B4 Science

Page 7 of 15
Table B: 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 ;
(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 Supervisor P001 13-Sep-2004 23-Aug-
Shyam 1981
12 Chander Operator P003 22-Feb-2010 12-Jul-1987
Nath
13 Fizza Operator P003 14-Jun-2004 14-Oct-1983
15 Ameen Machanic P002 21-Aug- 13-Mar-1984
Ahmed 2006
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’;

Page 8 of 15
27. (a) Write the outputs of the SQL queries (i) to (iv) based on the 2+1=3
relations PRODUCT and ORDER.
Table: PRODUCT
PID BRAND CITY_STOR PNAME PRICE
E
111 SONY DELHI TV 70000

222 NOKIA MUMBAI MOBILE 50000

333 ONIDA DELHI TV 30000

444 SONY MUMBAI MOBILE 35000

555 BLACKBERRY CHENNAI MOBILE 25000

666 DELL DELHI LAPTOP 20000

Table: ORDER
CID CNAME QTY PID
101 ROHAN SHARMA 20 222
102 DEEPAK KUMAR 10 666
103 MOHAN KUMAR 5 111
104 SAHIL BANSAL 3 333
105 NEHA SONI 7 444
106 SONAL AGARWAL 5 333
107 ARUN SINGH 15 666

(i) SELECT COUNT(*) , CITY_STORE FROM PRODUCT


GROUP BY CITY_STORE;
(ii) SELECT AVG(QTY) FROM ORDER
WHERE CNAME LIKE “%R%”;
(iii) SELECT CNAME, BRAND FROM PRODUCT, ORDER
WHERE PRODUCT. PID = ORDER.PID AND PNAME= “MOBILE”;
(iv) SELECT CNAME, QTY FROM ORDER WHERE QTY NOT
BETWEEN 5 AND 20;
(c) Write an SQL command to view all the Tables present in a
database named ‘SCHOOL’;
28. Write a function RevText() to read a text file “ Story.txt “ and Print the 3
word(s) starting with ‘I’ in reverse order, rest of the words will be printed
as it is.

Page 9 of 15
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.

29. Observe the following table and answer the parts (a) to (c): 3
Table: Store
ItemCode ItemName Qty Rate
10 Gel Pen Classic 1150 25
11 Sharpner 1500 10
12 Ball Pen 0.5 1600 12
13 Eraser 1600 5
15 Ball Pen 0.25 800 20

(a) Identify the most appropriate column, which can be considered as


Primary key of the Table Store.
(b) If three columns are added and one row is deleted from the table
Store, then what will be the new degree and cardinality of the
above table?
(c) Write an SQL statement to delete the record(s) of item having Rate
less than 10.

30. Mayank has created a dictionary containing names and marks as key value 3
pairs of 6 students. Write a function in Python PushName(S) to Push the
keys (name of the student) of the dictionary S into a stack, where the
corresponding value (marks) is greater than 75.
Also write a function POP(S) to delete an element from the stack S and
check for underflow in it.
For example: If the sample content of the dictionary is as follows

Page 10 of 15
S={"OM":66, "JAI":45, "BOB":95, "ALI":65, "ANU":90, "TOM":82}

The stack after invoking PushName(S) should contain


TOM
ANU
BOB
The stack after invoking POP(S) contain
ANU
BOB

SECTION-D
31. Consider the following tables ITEM and CUSTOMER, write SQL commands 1*4=4
for the statements (a) to (d)
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

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 in the
descending order of Customer_Name.
(b) To display the details of Items whose Price is not in the range of 35000
to 55000 (Both values included).

Page 11 of 15
(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.
32. Manish is a Python programmer working in a School. For the Result analysis 4
in School, he has created a csv file named student.csv, to store the results of
students in different Exams. The structure of record of file student.csv is
[RollNo, Name, Percentage] where, RollNo is the Roll Number of student
(integer), Name is the Student Name (string) and
Percentage is the percentage of marks secured by the student (float).
For efficiently maintaining data of the Result analysis, Manish wants to write
the following user defined functions.
(a) ADD() – To accept and add data of students to a CSV file ‘student.csv’.
(b) Display() – To read all content of “student.csv” and display records of
only those students who scored more than 90 percentage.

SECTION-E

33. “Sikshya for All” is an educational NGO. It is setting up its new campus at 1*5=5
Jaipur for its web-based activities. The campus has four buildings as shown in
the diagram below:

Main Building Resource Building

Training Building
Accounts Building

Page 12 of 15
Centre to Centre distances between various buildings as per architectural
drawings (in meters) is as follows:
Main Building to Resource Building 120 m
Main Building to Training Building 40 m
Main Building to Accounts Building 135 m
Resource Building to Training Building 125 m
Resource Building to Accounts Building 45 m
Training Building to Accounts Building 45 m
Expected number of Computers in each building:
Main Building 15
Resource Building 25
Training Building 250
Accounts Building 10

Answer the following based on the above:


(a) Suggest a cable layout of connections between the buildings.
(b) Suggest the most suitable place (i.e. building) to house the server of
this NGO. Also, provide a suitable reason for your answer.
(c) Suggest the placement of the following devices with justification:
(i) Repeater (ii) Hub/Switch
(d) The NGO is planning to connect its international office situated in
Delhi. Which out of the following wired communication links, will you
suggest for a very high-speed connectivity?
(i) Telephone Analog line (ii) Optic Fibre (iii) Ethernet cable
(e) Which of the following should be used to protect unauthorized access
in the network.
(i) Telnet (ii) Firewall (iii) Router
34. (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:

Page 13 of 15
▪ Bus Number
▪ Bus Starting Point
▪ Bus Destination
OR
(a) Write any two differences between ‘rb’ and ‘ab’ modes w.r.t. 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.
35. (a) Define the term Cardinality with respect to RDBMS. 1+4=5
(b) A company has stored the data of its employees in emp Table. The
management of the company has decided to increase the salary by 20%
of all those employees who belong to the IT Department. As a Software
programmer. Help the management by writing the following missing
statements 1-4 to complete the code:

import mysql.connector as mycon


mydb= #Statement 1
mycursor= #Statement 2
mycursor.execute ( ) #Statement 3
mydb. #Statement 4

Statement 1 - To form the database connection object.


Statement 2 - To form the cursor object.
Statement 3 - To execute the command that will increase the salary by
20% of all those employees who belong to the IT
Department.
Statement 4 - To make the changes after deletion of record permanently
in the database.
Note: The connection object parameters are localhost, user name is root
and password is 1234 and database name is Company.

Page 14 of 15
OR
(a) Define the term degree with respect to RDBMS.
(b) The code given below intends to delete a record from the table
‘Employee’ available in the database ‘Company’, whose ‘Dept’ is
‘Elect’ and Grade is ‘G4’. Write the following missing statements 1-4
to complete the code:
import mysql.connector as mycon
mydb= #Statement 1
mycursor= #Statement 2
mycursor.execute ( ) #Statement 3
mydb. #Statement 4
Statement 1 - To form the database connection object.
Statement 2 - To form the cursor object
Statement 3 - To execute the command that will delete the desired
record from the table ‘Employee’.
Statement 4 - To make the changes after deletion of record permanently
in the database.
Note: The connection object parameters are localhost, user name is root
and password is 1234.

Page 15 of 15

You might also like