Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
26 views11 pages

Common Pre-Board Examination 2023-24: General Instructions

The document outlines the Common Pre-Board Examination for Computer Science (083) for Class XII, scheduled for March 14, 2024, with a total of 35 questions divided into five sections. Each section varies in question count and marks, with programming questions to be answered using Python. The document includes specific instructions and examples of questions across different sections, covering topics in Python programming and SQL.

Uploaded by

ckamali5311
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)
26 views11 pages

Common Pre-Board Examination 2023-24: General Instructions

The document outlines the Common Pre-Board Examination for Computer Science (083) for Class XII, scheduled for March 14, 2024, with a total of 35 questions divided into five sections. Each section varies in question count and marks, with programming questions to be answered using Python. The document includes specific instructions and examples of questions across different sections, covering topics in Python programming and SQL.

Uploaded by

ckamali5311
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/ 11

COMMON PRE-BOARD EXAMINATION 2023-24

COMPUTER SCIENCE (083)


Date:14/03/2024 Time Allowed:3 hours
Class: XII Maximum Marks: 70

General Instructions:
1. Please check this question paper contains 35 questions.
2. The paper is divided into 4 Sections- A, B, C, D and E.
3. Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
4. Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
5. Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
6. Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
7. Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
8. All programming questions are to be answered using Python Language only.

Q. SECTION A Marks

1. State True or False 1


“Python language is a Cross platform language.”

2. Which of the following is an identity operator in Python? 1


a. is
b. on
c. in
d. of
3. What will be the output of the following statement? 1
print(2**3 + (5 + 6)**(1 + 1))

a. 129
b. 8
c. 121
d. None
4. For a function header as follows, 1
def Calc (X, Y=20) :
Which of the following function calls will give an error?

a. Calc(15, 25)
b. Calc(x=15, y=25)
c. Calc(y=25)
d. Calc( x=25)
5 Which type of join is the following SQL statement ? 1
SELECT customer.cust_id, order.cust_id, name, order_id FROM

1
customer, order;

a. Equi-join
b. Natural join
c. Outer join
d. Cartesian product

6 Which of the following statements is True about joins in SQL? 1

a. In natural join query the join condition has to be mention.


b. In cartesian product, the degree of the resultant table is equal to the sum of
the degree of table1 and the degree of table2.
c. In equi-join, the resultant table will not have duplicate columns.
d. In cartesian product, the cardinality of the resultant table is equal to the sum of
the cardinality of table1 and the cardinality of table2.
7. Consider the statements given below and then choose the correct output from 1
the given options:

L=["Every", "day", "is", "a" ,"second" ,"chance"]


print(L[:-3:])

a. ['a', 'second', 'chance']


b. ['chance', 'second', 'a']
c. ['Every', 'day', 'is']
d. ['is', 'day', 'Every']
8. Consider the statements given below and then choose the correct output from 1
the given options:
S="Technology Fest@2023"
print(S[3:-3:3])

a. cogFt
b. 0tFgo
c. hlye@
d. hlye@0
9. Which of the following statement(s) would give an error after executing the 1
following code?

S=’Happy’ # Statement 1
print(S*3) # Statement 2
S+=” Republic” # Statement 3
S.append(“ Day”) # Statement 4
print(S) # Statement 5

a. Statement 2 b. Statement 3
c. Statement 4 d. Statement 3 and 4

10. seek() is a method of _____________ . 1

2
a. File object
b. csv module
c. pickle module
d. math module
11. The modem at the receiver’s computer end acts as a ___________. 1

a. Translator
b. Modulator
c. Demodulator
d. Converter
12. Which of the following file mode will make the file zero length while opening? 1
a. ab
b. wb
c. rb
d. None of these
13. What possible outputs(s) are expected to be displayed on screen at the time of 1
execution of the following code?
import random
AR = [20,30,40,50,60,70]
Lower =random.randint(1,3)
Upper =random.randint(2,4)
for K in range(Lower, Upper +1):
print (AR[K], end=”#“)
a. 20#40#70#
b. 30#40#50#
c. 50#60#70#
d. 40#50#60#
14. Which of the following commands will change row(s) of the table from MySQL 1
database?
a. REPLACE TABLE
b. CHANGE TABLE
c. UPDATE
d. ALTER TABLE
15 A _____________ is a networking device that connects computers in a network 1
by using packet switching to receive, and forward data to the destination.

a. Switch
b. Hub
c. Router
d. Repeater
16 Ms. Suman is working on a binary file and wants to write data from a list to a 1
binary file. Consider list object as L, binary file sum_list.dat, and file object as f.
Which of the following can be the correct statement for her?
a. f = open(‘sum_list.dat’,’wb’); pickle.dump(L,f)
b. f = open(‘sum_list.dat’,’rb’); L=pickle.dump(f)
c. f = open(‘sum_list.dat’,’wb’); pickle.load(L,f)
d. f = open(‘sum_list.dat’,’rb’); L=pickle.load(f)

3
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):- print(f1( )) is a valid statement even if the function f1( ) 1


has no return statement.
Reasoning (R):- A function always returns a value even if it has no return
statement.
18 Assertion (A): If L is a list, then L+=range(5) is an invalid statement. 1
Reason (R): Only a list can be concatenated to a list.

SECTION B
19 Expand HTML and XML. Write differences between HTML and XML. 2
OR
Expand SMTP and POP. Write differences between SMTP and POP

20 Mohit has written a code to input a positive integer and display its factorial. His 2
code is having syntax and logical errors. Rewrite the correct code and underline
the corrections made. (factorial of a number n is the product 1x2x3. . .n)
n=(input("Enter a positive integer: ")
f=0
for i in range(n)
f*=i
print(f)

21 Write a function, Words(S), that takes a string as an argument and returns a list 2
containing words of the string that has vowels.

OR

Write a function SQUARE_LIST(L), where L is the list of elements passed as


argument to the function. The function returns another list named ‘SList’ that
stores the Squares of all Non-Zero Elements of L.
For example:
If L contains [9,4,0,11,0,6,0]
The SList will have - [81,16,121,36]

4
22 What will be the output of the following code ? 2

t1= ['CS','IP','IT']
list1=t1
new_list = []
for i in list1:
if t1.index(i) %2 !=0:
new_list.append(t1.pop())
elif t1.index(i) //2 ==0:
new_list.append(t1.insert(len(t1)-1,t1.pop()))
print(new_list,list1,t1,sep='#')

23 (a) Write a Python statement to display alternate characters of a string, 2


named my_exam. For example,

if my_exam="Russia Ukraine"
The statement should display “Rsi kan”

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

d1 = {"name": "Aman", "age": 26}


d2 = d1.pop('name')
print(d1, d2)
24 Write the SQL statement to add a field Country_Code (of type Integer) to the 2
table Countries with the following fields. Country_id, Country_name, Continent,
Region_id. Thereafter write a command to insert the following record to the
table.
C001, China , Asia, R123, 423

OR

A table, SPORTSTARS has been created in a database with the following


fields: Admn_No, Name, DOB, Sport, Medals, Class. Give the SQL
command to delete the column Class from this table. Also write a command to
make the Admn_No the Primary key.
25 Find the output of the following Python code: 2

a=5
def update(x):
global a
a+=5
if x%2 != 0:
a*=x*2
else:
a//=x

5
a=a+4
print(a,end='$')
update(3)
print(a,end='#')
update(a)
print(a)
SECTION C

26 3
The contents of a text file named ‘quote.txt’ is as shown below:
All the kings horses and all the kings men
cannot fix what isn’t broken.
What will be the output of the following code?

fin = open('quote.txt’)
data = fin.read(10)
print(data[0:3], end= ‘’)
data = fin.readline()
print(data[0:3] , end= ‘’)
fin.seek(0)
data = fin.read(6)
print(data[0:3] , end= ‘’)
27 Based on table STUDENT given here, write the output of the SQL queries that 3
follow:

RollNo Name Class Gender City Mark

1 Abhishek XI M Agra 430

2 Prateek XII M Mumbai 440

3 Sneha XI F Agra 470

4 Nancy XII F Mumbai 492

5 Hema XII F Delhi 360

6 Anchal NULL F Dubai 256

7 Mehar X F Moscow 324

8 Nishant X M Moscow 429

1. SELECT NAME, CLASS, MARK FROM STUDENT WHERE NAME LIKE


“%E%” AND CLASS =’XII’;
2. SELECT NAME, CITY FROM STUDENT WHERE GENDER = ‘M’ AND
MARK BETWEEN 360 AND 440;

6
3. SELECT DISTINCT CLASS FROM STUDENT;

28 Write a method count_words_e() in Python to read the content of a text file and 3
count the number of words ending with 'e' in the file.
Example: If the file content is as follows:
An apple a day keeps the doctor away. We all pray for everyone’s safety. A
marked difference will come in our country.
The count_words_e() function should display the output as:
No. of such words: 4

OR

Assume that a text file named TEXT1.TXT already contains some text written
into it, write a user defined function named vowelwords(),that reads the file
TEXT1.TXT and create a new file named TEXT2.TXT ,which shall contain only
those words from the file TEXT1.TXT which does not start with an uppercase
vowel(i.e. with ‘A’,’E’,’I’,’O’,’U’)
for example
if the file TEXT1.TXT contains
Carry Umbrella and Overcoat When it Rains

then the file TEXT2.TXT shall contain


Carry and when it Rains.

29 Consider the table Purchase given below: 3


Table : PURCHASE

CNO CNAME CITY QUANTITY DOP

C01 GURPREET NEW DELHI 150 2023-06-11

C02 MALIKA HYDERABAD 10 2023-02-19

C03 NADAR DALHOUSIE 100 2022-12-04

C04 SAHIB CHANDIGARH 50 2022-10-10

C05 MEHAK CHANDIGARH 15 2022-10-20

Based on the given table, write SQL queries for the following:
1. Increase the quantity by 3 % for all purchase in CHANDIGARH.
2. Display name, city and date of purchase of all purchases of names that
contain the letter ‘H’.
3. Delete the records of all purchase in NEW DELHI.
30 A nested list contains the data of visitors in a museum. Each of the inner lists 3
contains the following data of a visitor:
[V_no (int), Date (string), Name (string), Gender (String M/F), Age (int)]

7
Write the following user defined functions to perform given operations on the
stack named "status":

(i) Push_element(Visitors) - To Push Gender of visitors who are in the


age range of 15 to 20.

(ii) Pop_element( ) - To Pop the objects from the stack and count the display
the number of Male and Female entries in the stack. Also, display “Done”
when there are no elements in the stack.

For example: If the list Visitors contains:


[['305', "10/11/2022", “Geeta”, "F”, 35],
['306', "10/11/2022", “Arham”, "M”, 15],
['307', "11/11/2022", “David”, "M”, 18],
['308', "11/11/2022", “Madhuri”, "F”, 17]]

The stack should contain


M
M
F
The output should be:
Done
Female: 1
Male: 2

SECTION D

31 4

Write SQL commands for the queries (i) - (iv) based on the two tables
TAXITYPE and TRAVEL

TABLE: TAXITYPE
TCODE TTYPE PER
KM
T01 TEMPO TRAVELLER 40
T02 AC INNOVA 20
T03 AC ERTIGA 15
T04 AC HATCHBACK 10
T05 AC SEDAN 10

TABLE: TRAVEL

8
CNO CNAME TRAVELDATE KM TCODE NOP
101 Randeep 2018-11-07 200 T01 12
102 Sharad Bali 2018-12-21 120 T04 4
105 Sangeeta M 2019-04-25 450 T01 15
103 Manish Nagpal 2019-01-29 280 T02 5
107 Veronica 2019-03-12 365 T04 2
104 Dinesh Hoon 2019-10-28 290 T05 4

i. Display cname and ttype from the tables taxitype and travel.
ii. Display the average Km and greatest PERKM of AC SEDAN and AC
ERTIGA types.
iii. Display the cname, KM and NOP of all travel in the descending order
of KM.
iv. Display the details of all travels with traveldate after 2019-05-10

32 A csv file product.csv contains records of the following structure: 4


prodno, prodname and price to store the product no , product name and price
of the product .
Write a Program in Python that defines and calls the following user defined
functions:
(i) ADD_PROD() – To accept and add information about a product into a
csv file named ‘product.csv’.
(ii) DISPLAY_PROD() – To display details of products having price
more than 100 and productname starting with ‘P’, present in the CSV
file named ‘product.csv’.
SECTION E

33 “Knowledge Share” an NGO is planning to setup its new campus at Nagpur for 1*5=5
its web-based activities. The campus has four (04) UNITS as shown below:

Distance between above UNITs are given here as under:

9
UNIT - 1 UNIT – 2 DISTANCE (In meters)
ADMIN TRAINING 60
ADMIN RESOURCE 120
ADMIN FINANCE 100
FINANCE TRAINING 65
FINANCE RESOURCE 40
TRAINING RESOURCE 50

Number of Computers in various units are:


UNIT NO. OF COMPUTERS
ADMIN 150
FINANCE 25
TRAINING 90
RESOURCE 50
a) Suggest an ideal cable layout for connecting the above UNITs and which
topology it is?
b) Suggest the most suitable place (i.e., UNIT) to install the server for the
above NGO. Also, provide a suitable reason.
c) Is there a requirement of a repeater in the given cable layout? Why/ Why
not?.
d) NGO is planning to connect its Regional Office at Kota, Rajasthan. Which
out of the following wireless communication, will you suggest for a high-
speed connectivity?
(a) radiowave (b) infrared wave (c) Satellite.
e) Which network device is used to connect the computers in all UNITs?
34 i. Write the difference between append (a) and write (w) mode in a text file. 2+3=
5
ii. A binary file named “EMP.DAT” has some records of the structure [EmpNo,
EmpName, Post, Salary].
Write a user-defined function named SumSalary(Post) that will accept the
post of employee an argument & read the contents of EMP.DAT and
calculate the total salary of all employees of that Post.

OR
i. Give one difference between seek() and tell() functions in file handling.
ii. A binary file “TEST.DAT” has some records of the [TestId, Subject,
MaxMarks, ScoredMarks]. Write a function in python named
DisplayAvgMarks(Sub) that will accept a subject as an argument and read the
contents of TEST.DAT. The function will calculate & display the Average of
the ScoredMarks of the subject accepted as an argument.

10
35 1+4=
5
i. Define primary key and alternate key with examples.
ii. Reena wants to write a program in Python that reads and fetches all the
records from Mysql table EMP having salary more than 25000.
empno - integer,
ename- string and salary- integer.
Note the following to establish connectivity between Python and MYSQL:
▪ Username is root
▪ Password is tiger
▪ The table exists in a MYSQL database named company.

OR

i. Differentiate between DDL and DML commands in SQL


ii. Write a Python code that inserts the following record in the MySQL table
Emp:
EmpNo – integer
EName – string
Desig – string
Salary – integer
Note the following to establish connectivity between Python and
MySQL:
• Username is admin
• Password is 22admin66
• The table exists in a MySQL database named company.
• The details (EmpNo, EName, Desig and Salary) are to be
accepted from the user.

11

You might also like