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

12th preboard2 d

The document is a question paper for Pre-Board 2 for the session 2024-2025, consisting of 37 compulsory questions divided into five sections with varying marks. It includes questions on Python programming, SQL queries, and theoretical concepts in computer science. Each section has a specific number of questions and marks assigned, with internal choices provided for some questions.

Uploaded by

Abha Datar
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)
16 views

12th preboard2 d

The document is a question paper for Pre-Board 2 for the session 2024-2025, consisting of 37 compulsory questions divided into five sections with varying marks. It includes questions on Python programming, SQL queries, and theoretical concepts in computer science. Each section has a specific number of questions and marks assigned, with internal choices provided for some questions.

Uploaded by

Abha Datar
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/ 14

Pre-Board 2

Session – 2024-2025
Time Allowed: 3 hours Maximum Marks: 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.

Section A
1. State true or false: [1]
The expression 2**2**3 is evaluated as: (2**2)**3.

2. Fill in the blank. [1]


is a number of tuples in a relation.

a) Domain b) Cardinality

c) Attribute d) Degree

3. >>> m = [[x, x*2, x*3] for x in range (3,6)] [1]

a) Error b)[3,6,9,[4,8,12,[5,10,15]]]

c)[[3,6,9],[4,8,12],[5,10,15]] d)[3,6,9,4,8,12,5,10,15]

4. Following set of commands are executed in shell, what will be the output? [1]
>>> str = "hello"
>>> str[:2]
a) he b) llo

c) ello d) hel

5. What is the output of the following expression? [1]


print([4.00/(2.0 + 2.0),4.00/2.0 + 2.0,4.00/2.0/2.0])

6. The virus that uses MS Office suite as its host to replicate is known as? [1]

a) Trojan b) Worm

c) Macro Virus d) Word Virus

7. Which of the following command is used to open a file "c:\pattxt" for writing in [1]
binary format only?

a) fout = open("c:\\pat.txt", "wb") b) fout = open("c: \pat.txt", "w+")

c) fout = open("c:\ \pat.txt", d) fout = open("c: \ pat.txt", "w")


"wb+")

8. User can write Python script using [1]

a) SQL.connect library b) MySQL.connector library

c) MySQL.connect library d) MySQL.connect library

9. Which of the following group functions ignore NULL values? [1]

a) MAX b) All of these

c) SUM d) COUNT

10. How are following codes different from one another? [1]
i. my_file = open('poem.txt', 'r')
my_file.read()
ii. my_file = open('poem.txt', 'r')
my_file.read(100)

11. State true or false: a


l
The max() and min() when used with tuples, can work if elements of the tuple are
l
of the same type. [1]
12. form of access is used to add/remove nodes from a stack. [1]

a) Both of LIFO and FIFO b) FIFO

c) LIFO d) Weighted

13. Name any two logical operators. [1]

14. Fill in the blank : [1]


In switching, before a communication starts, a dedicated path is
identified between the sender and the receiver.

a) Circuit b) Packet

c) Plot d) Graph

15. What is the output of sys.platform [:2] if the code runs on windows operating [1]
system?

a) 'wi' b) Error

c) 'op' d) 'sy'

16. Which of the following command is used to remove the table definition and all [1]
data?

a) Choose b) Drop

c) Create d) Select

17. Find EVEN parity bit for 10010001 [1]

a) 1 b) 3

c) 2 d) 0

18. In peer-to-peer network, each computer in a network is referred as [1]

a) server b) sender

c) client d) peer

19. Assertion (A): In python break is used to bring the program control out of the loop. l
Reason (R): The break is commonly used in the cases where we need to break the o
op for a given condition. [1]
a) Both A and R are true and R is b) Both A and R are true but R is
the correct explanation of A. not the correct explanation of
A.

c) A is true but R is false. d) A is false but R is true.

20. Assertion(A): In Python, the csv.reader() module is used to read the CSV file. [1]
Reason(R): We can also use DictReader() function to read the CSV file directly
into a dictionary rather than deal with a list of individual integer elements.

a) Both A and R are true and R is b) Both A and R are true but R is
the correct explanation of A. not the correct explanation of
A.

c) A is true but R is false. d) A is false but R is true.

21. Assertion (A): Python provides us the flexibility to offer the comma-separated [1]
values which are internally treated as tuples at the function call.
Reason (R): By using the variable-length arguments, we can pass any number of
arguments.

a) Both A and R are true and R is b) Both A and R are true but R is
the correct explanation of A. not the correct explanation of
A.

c) A is true but R is false. d) A is false but R is true.

Section B
22. What measures do wireless networks employ to avoid collisions? [2]

23. Consider the following table Traders with following fields [2]
TCode TName City
T01 Electronic Sales Mumbai
T03 Busy Store Corp Delhi
T02 Disp House Inc Chennai
Write Python code to display the names of those traders who are either from Delhi
or from Mumbai.

24. Find the errors in following code and write the correct code. D
e
f s(x): [2]
a = ‘k'
print(a * x)
print(a * str(x))
for in [1, 2', 10 :
s(n)
i. Underline the corrections
ii. Write the reason!error next to it in comment form.

OR
How can you add following data in empty dictionary?
Keys Values
A One
B Two
C Three
D Four

25. Consider the table Persons whose fields are P_ID, LastName, FirstName, Address, [2]
City. Write a Python code to add a new row but add data only in the P_Id,
LastName and columns as 5, Peterson, Kari respectively.

26. What is the output of the following? [2]


x = 12
for i in x:
print(i)

OR
Rewrite the following code into for loop:
i=3
while (i < 5):
if (i == 4):
print("Welcome")
else:
print("No entry")
i=i+1
print("value of i", i)

27. Explain seek() method. [2]


OR
A text file "PARA.txt" contains a paragraph. Write a function that searches for a given
character and reports the number of occurrence of the character in the file.

28. Write a function that accepts two parameters: a dictionary and a number; and prints [2]
only the keys that have values more than the passed number.

Section C
29. Write a function that takes a list that is sorted in ascending order and a number as [3]
argument. The function should do the following:
i. Insert the number passed as argument in a sorted list.
ii. Delete the number from the list.

OR
How are following two statements different?
import math
from math import *

30. Give output for following SQL queries as per given table(s): [3]
Table: INTERIORS

ITEM
NO. TYPE DATEOFSTOCK PRICE DISCOUNT
NAME
Double
1. Red rose 23/02/02 32000 15
Bed
2. Soft-touch Baby cot 20/01/02 9000 10
Jerry's
3. Baby cot 19/02/02 8500 10
home
Rough Office
4. 01/01/02 20000 20
wood Table
Comfort Double
5. 12/01/02 15000 20
zone Bed
6. Jerry look Baby cot 24/02/02 700 19
Office
7. Lion king 20/02/02 16000 20
Table
8. Royal tiger Sofa 22/02/02 30000 25

9. Park sitting Sofa 13/12/01 9000 15


Dine Dining
10. 19/02/02 11000 15
Paradise Table
i. SELECT COUNT (DISTINCT TYPE) FROM INTERIORS;
ii. SELECT AVG(DISCOUNT) FROM INTERIORS WHERE TYPE = "Baby cot"
;
iii. SELECT SUM(PRICE) FROM INTERIORS WHERE DATEOFSTOCK<
{12/02/02}.

OR
i. Write two examples of DBMS software.
ii. What is meant by NULL value in MySQL?
iii. Table 'Club' has 4 rows and 3 columns. Table 'Member' has 2 rows and 5 columns.
What will be the cardinality of the Cartesian product of them?

31. Write a method in Python to find and display the prime number between 2 to n. [3]
Pass n as an argument to the method.

OR
Write a function that receives two tuples and creates a third that contains all elements of
the first followed by all elements of the second.

Section D
32. Write the Push operation of stack containing person names. Notice that the name [4]
should only accept characters, spaces and period (.) except digits. Assume that
Pname is a class instance attribute.

OR
A line of text is read from the input terminal into a stack. Write a program to output the
string in the reverse order, each character appearing twice.
(ie.g., the string a b c d e should be changed to ee dd cc bb aa)

33. Write one difference between CSV and text files. W


rite a program in Python that defines and calls the following user defined [4]
functions:
i. COURIER_ADD () : It takes the values from the user and adds the details to a
csv file 'courier.csv'. Each record consists of a list with field elements as cid, s
name, Source, destination to store Courier ID, Sender name, Source and
destination address respectively.
ii. COURIER_SEARCH () : Takes the destination as the input and displays all the
courier records going to that destination.

34. Consider the following tables GAMES and PLAYER and answer (b) and (c) parts [4]
of this question:

Table: GAMES
GCode Game Name Type Number Prize Money Schedule Date
101 Carom Board Indoor 2 5000 23-Jan-2004
102 Badminton Outdoor 2 12000 12-Dec-2003
103 Table Tennis Indoor 4 8000 14-Feb-2004
105 Chess Indoor 2 9000 01-Jan-2004
108 Lawn Tennis Outdoor 4 25000 19-Mar-2004

Table: PLAYER
PCode Name GCode
1 Nabi Ahmad 101
2 Ravi Sahai 108
3 Jatin 101
4 Nazneen 103
a. What do you understand by primary key and candidate keys?
b. Write SQL commands for the following statements:
i. To display the name of all GAMES with their GCodes.
ii. To display details of those GAMES which are having PrizeMoney more than
7000.
iii. To display the content of the GAMES table in ascending order of Schedule
Date.
iv. To display sum of PrizeMoney for each type of GAMES.
c. Give the output of the following SQL queries:
i. SELECT COUNT (DISTINCT Number) FROM GAMES;
ii. SELECT MAX(ScheduleDate), MIN (ScheduleDate) FROM GAMES;
iii. SELECT Name, GameName FROM GAMES G, PLAYER P WHERE
(G.Gcode= P.Gcode AND G.PrizeMoney>10000);
iv. SELECT DISTINCT Gcode FROM PLAYER;

OR
Write SQL commands for (i) to (v) on the basis of table INTERIORS.
TABLE: INTERIORS
No. ITEM NAME TYPE DATE OF STOCK PRICE DISCOUNT
1 Red rose Double Bed 23/02/02 32000 15
2 Soft touch Baby cot 20/01/02 9000 10
3 Jerry’s home Baby cot 19/02/02 8500 10
4 Rough wood Office Table 01/01/02 20000 20
5 Comfort zone Double Bed 12/01/02 15000 20
6 Jerry look Baby cot 24/02/02 7000 19
7 Lion king Office Table 20/02/02 16000 20
8 Royal tiger Sofa 22/02/02 30000 25
9 Park sitting Sofa 13/12/01 9000 15
10 Dine Paradise Dining Table 19/02/02 11000 15
11 White Wood Double Bed 23/03/03 20000 20
12 James 007 Sofa 20/02/03 15000 15
13 Tom look Baby cot 21/02/03 7000 10

i. To show all information about the Sofa from the INTERIORS table.
ii. To list the ITEMNAME, which are priced at more than 10000 from the INTERIORS
table.
iii. To list ITEMNAME and TYPE of those items, in which DATEOFSTOCK is before
22/01/02 from the INTERIORS table in descending order of ITEMNAME.
iv. To insert a new row in the INTERIORS table with the following data
{14, 'Truelndian' , 'Office Table', '25/03/03', 15000, 20}
v. To display the name of item with their price which have discount more than 20.

35. Here is a table Club [4]


Memberld MemberName Address Age Fee
M001 Sumit New Delhi 20 2000
M002 Nisha Gurgaon 19 3500
M003 Niharika New Delhi 21 2100
M004 Sachin Faridabad 18 3500

Write the Python code for the following


i. Update the Address of member whose Memberld is M003 with Noida.
ii. Delete the record of those member whose name is Sachin.

Section E
36. The Freshminds University of India is starting its first campus in Ana Nagar of [5]
South India with its center admission office in Kolkata. The university has 3 major
blocks comprising of Office Block, Science Block and Commerce Block in the 5
km area Campus.

As a network expert, you need to suggest the network plan as per (i) to (iv) to the
authorities keeping in mind the distance and other given parameters.
Expected Wire distances between various locations:
Office Block to Science Block 90 m
Office Block to Commerce Block 80 m
Science Block to Commerce Block 15 m
Kolkata Admission office to Ana Nagar Campus 2450 km
Expected number of Computers to be installed at various locations in the University
are as follows:
Office Block 10
Science Block 140
Commerce Block 30
Kolkata Admission office 8
i. What type of server should be installed in university?
Dedicated
Non-dedicated

You might also like