0% found this document useful (0 votes)
117 views8 pages

QP Class Xii CS PB 2022

This document contains instructions for a Computer Science pre-board exam. It provides general instructions, section details, and 18 multiple choice questions in Section A. Section B contains 7 short answer questions worth 2 marks each. Section C has 5 short answer questions worth 3 marks each. Section D has 3 long answer questions worth 5 marks each. Section E has 2 questions worth 4 marks each with an internal choice in one question. Programming questions must be answered in Python.

Uploaded by

SANJAY PARMAR
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)
117 views8 pages

QP Class Xii CS PB 2022

This document contains instructions for a Computer Science pre-board exam. It provides general instructions, section details, and 18 multiple choice questions in Section A. Section B contains 7 short answer questions worth 2 marks each. Section C has 5 short answer questions worth 3 marks each. Section D has 3 long answer questions worth 5 marks each. Section E has 2 questions worth 4 marks each with an internal choice in one question. Programming questions must be answered in Python.

Uploaded by

SANJAY PARMAR
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/ 8

केंद्रीय विद्यालय संगठन, अहमदाबाद संभाग 2022-23

KENDRIYA VIDYALAYA SANGATHAN, AHMEDABAD REGION 2022-23


प्री-बोर्ड परीक्षा - 2022
PRE-BOARD EXAMINATION - 2022

SUBJECT: Computer Science (083) M.M.: 70


CLASS: XII TIME: 3 Hours

GENERAL INSTRUCTIONS:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A have 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 03 Long Answer type questions carrying 05 marks each.
7. Section E has 02 questions carrying 04 marks each. One internal choice is given in
Q35 against part c only.
8. All programming questions are to be answered using Python Language only.
SECTION – A
1 Which of the following is valid logical operator in Python: 1
(a) > (b) and (c) ** (d) OR
2 Write the valid identifier in the following: 1
(a) My.File (b) My-File (c) 2num (d) While
3 Write the statements to find square root of 25. 1

4 x={‘cs’:90,’maths’:84} 1
y={‘eng’:75,’phy’:87}
Write the statements to merge above two dictionaries.
(a) x+y (b) x.add(y) (c) x.join(y) (d) x.update(y)
5 5!=10 and not 10>15 or 5>10 1
Write the output of the given expression.
(a) False (b) None (c) True (d) false
6 The readlines() method returns: 1
(a) String (b) A list of integers
(c) A list of single characters (d) A list of lines
7 Suppose list1 = [0.5 * x for x in range(0,4)], 1
list1 is :
(a) [0, 1, 2, 3] (b) [0, 1, 2, 3, 4]
(c) [0.0, 0.5, 1.0, 1.5] (d) [0.0, 0.5, 1.0, 1.5, 2.0]
8 Which is known as range operator in MySQL? 1
( a) IN (b) BETWEEN (c) IS (d) DISTINCT
9 If column “salary” of table “EMP” contains the dataset {10000, 15000, 25000, 1
10000, 25000}, what will be the output of following SQL statement?
> SELECT SUM(DISTINCT SALARY) FROM EMP;
(a) 85000 (b) 25000 (c) 10000 (d) 50000
10 The following SQL is which type of join: 1
SELECT CUSTOMER.CUST_ID, ORDER.CUST_ID, NAME, ORDER_ID FROM
CUSTOMER, ORDER;
(a) Equi-join (b) Natural join (c) Outer join (d) Cartesian product
Page 1 of 8
11 TCP/IP stands for 1
(a) Transmission Communication Protocol / Internet Protocol
(b) Transmission Control Protocol / Internet Protocol
(c) Transport Control Protocol / Interwork Protocol
(d) Transport Control Protocol / Internet Protocol
12 Which is not a constraint in SQL? 1
( a) Unique (b) Distinct (c) Primary key (d) check
13 Consider the given expression: 1
51+4-3**3//19-3
Which of the following will be correct output if the given expression is evaluated?
(a) 50 (b) 51 (c) 52 (d) 55
14 Identify the name of connector to establish bridge between Python and MySQL 1
(a) mysql.connection (b) connector (c) mysql.connect (d) mysql.connector
15 The keys of a dictionary must be of ______ types. 1
(a) integer (b) mutable (c) immutable (d) None of these
16 What is the meaning of Remark LIKE “%5%5%”? 1
(a) Column Remark begins with two 5
(b) Column Remark ends with two 5
(c) Column Remark has more than two 5
(d) Column Remark has two 5 in it, at any position
17 Assertion (A): Python variable cannot hold values of different types at different 1
times.
Reason (R): Python supports dynamic typing.
a) Both A and R are true and R is the correct explanation of A.
b) Both A and R are true but R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.
18 Assertion (A): In the case of rb mode, the file pointer exists at the beginning of 1
the file.
Reason (R): In the case of rb+ mode, the file pointer exists at the end of the file.
a) Both A and R are true and R is the correct explanation of A.
b) Both A and R are true but R is not the correct explanation of A.
c) A is true but R is false.
d) A is false but R is true.
SECTION -B

19 Rewrite the following code in python after removing all syntax error(s). 2
Underline each correction done in the code.
M= int(input("Enter a number")
for K in range(0,11):
if M=K:
print(M+K)
else
Print(M-K)
20 Write difference between HTML and XML. 2
OR
Write difference between IPv4 and IPv6
21 (a) Write output of the given expression : 1
> 18 % 4 ** 3 // 7 + 9 1
(b) Write output of the code given below :
> msg = “KVS Ahmedabad”
> print(msg [ : : -2])

Page 2 of 8
22 Differentiate between fetchone( ) and fetchall( ) function. 2

23 (a) Expand the following terms : 1


(i) GSM (ii) CDMA
(b) Define about the network device : MODEM 1

24 Predict the output of the Python code given below. 2


Text="Welcome Python"
L=len(Text)
ntext=""
for i in range (0,L):
if Text[i].isupper():
ntext=ntext+Text[i].lower()
elif Text[i].isalpha():
ntext=ntext+Text[i].upper()
else:
ntext=ntext+"!!"
print (ntext)
OR
Predict the output of the Python code given below.

def Change(M,N):
for i in range(N):
if M[i]%5==0:
M[i]//=5
if M[i]%3==0:
M[i]//=3
L=[25,8,75,12]
Change(L,4)
for i in L:
print(i, end=”#”)
25 Define the primary key and foreign key with example. 2
OR
Define the check and default constraint with example.
SECTION – C

26 Write the query (i) and Output of SQL Queries (ii) to (v) based on PRODUCTS 1+2
table.
Table:
PCODE PNAME COMPANY PRICE STOCK WARRANTY
P001 TV BPL 10000 2200 3
P002 TV SONY 12000 150 4
P003 PC LENOVO 39000 100 NULL
P004 PC COMPAQ 38000 120 2
P005 HANDICAM SONY 18000 250 3
(i) Increase the stock as 100 Rs whose company name is SONY.
(ii) select distinct company from PRODUCTS;
(iii) select max(price) from PRODUCTS where warranty<=3;
(iv) select PNAME, sum(price) from PRODUCTS group by PNAME;
(v) select count(warranty) from PRODUCTS;
27 Write a function Show_cap() in Python to read content of a text file ‘NOTES.TXT’ 3
and display the entire content in capital letters. Example, if the file contains :
Wish you all the Best.
Page 3 of 8
Then the function should display output to be :
WISH YOU ALL THE BEST.
OR
Write a function Display_Lines() in Python which should read lines from a text file
MYFILE.TXT and display the lines starting with the alphabet K. Example, if the file
contains:
Kavita sighed.
It was an usually warmer day.
Keeping one’s hands cleaner was the only option.
Then the function should display:
Kavita sighed.
Keeping one’s hands cleaner was the only option.
28 Write the outputs SQL query (i) to (iv) based on the relations employee and Job 3
given below
Table : Employee
EmployeeId Name Sales JobId
E1 Sumit Sinha 110000 102
E2 Vijay Singh Tomar 130000 101
E3 Ajay Rajpal 140000 103
E4 Mohit Kumar 125000 102
E5 Sailja Singh 145000 103
Table: Job
JobId JobTitle Salary
101 President 200000
102 Vice President 125000
103 Administrator Assistant 80000
104 Accounting Manager 70000
105 Accountant 65000
106 Sales Manager 80000
(a) Give the output of following SQL statement:
(i) Select max(salary),min(salary) from job
(ii) Select Name,JobTitle, Sales from Employee,Job
where Employee.JobId=Job.JobId and JobId in (101,102)
(iii) Select JobId, count(*) from Employee group by JobId
(iv) Select name, EmployeeId from Employee where Name like ‘s%’;
(b) Display structure of the table employee.
29 Write a Python function to store the odd values and even values of the given list 3
as per the example given below :
Sample List : [23, 12, 4, 27, 10, 7, 54]
Expected Output :
original list : [23, 12, 4, 27, 10, 7, 54]
even list [12, 4, 10, 54]
odd list [23, 27, 7]
30 Reva has created a dictionary containing Product names and prices as key value 3
pairs of 4 products. Write a user defined function for the following:
● PRODPUSH() which takes a list as stack and the above dictionary as the
parameters. Push the keys (Pname of the product) of the dictionary into a stack,
where the corresponding price of the products is less than 6000. Also display the
count of elements pushed into the stack.

For example: If Reva has created the dictionary is as follows:


Product={"TV":10000, "MOBILE":4500, "PC":12500, "FURNITURE":5500}
Page 4 of 8
The stack should contain :
FURNITURE
MOBILE
The output should be :
The count of elements in the stack is : 2
OR
Alam has a list containing 10 integers. You need to help him create a program
with separate user defined functions to perform the following operations based on
this list.
● Traverse the content of the list and push the even numbers into a stack.
● Pop and display the content of the stack. For Example: If the sample Content of
the list is as follows:
N=[12, 13, 34, 56, 21, 79, 98, 22, 35, 38]
Sample Output of the code should be: 38 22 98 56 34 12

SECTION – D

31 Quick Learn University is setting up its academic blocks at Delhi and planning to 5
set up a network. The university has 3 academic blocks and one human resource
Centre as shown in the diagram given below:

Business Park Technology


block

Law Block H R Block

Centre-to-Centre distance between various blocks is as follows:


Law block to business block 40 m
Law block to technology block 80 m
Law block to HR block 105 m
Business block to technology block 30 m
Business block to HR block 35 m
Technology block to HR block 15 m
Number of computers in each of the buildings is as follows:
Law block 15
Technology block 40
HR Centre 115
Business block 25
(a) Suggest a cable layout of connection between the blocks.
(b) Suggest the most suitable place to house the server of the organization with
suitable reason.
(c) Which device should be placed /installed in each of these blocks to efficiently
connect all the computers within these blocks?
(d) The university is planning to link its sales counters situated in various parts of
the other cities of country. Which type of network out of LAN, MAN or WAN will be
formed?
(e) Suggest the protocol that shall be needed to provide Video Conferencing
solution between HR Block and sales counter in Mumbai.

Page 5 of 8
32 (a) Find the output 2+3

Msg1="WeLcOME"
Msg2="GUeSTs"
Msg3=""
for I in range(0,len(Msg2)+1):
if Msg1[I]>="A" and Msg1[I]<="M":
Msg3=Msg3+Msg1[I]
elif Msg1[I]>="N" and Msg1[I]<="Z":
Msg3=Msg3+Msg2[I]
else:
Msg3=Msg3+"*"
print(Msg3)

(b) Your friend Jagdish is writing a code to fetch data from a database Shop and
table name Products using Python. He has written incomplete code. You have to
help him write complete code:
import as m # Statement-1
object1 = m.connect(host="localhost", user="root", password="root",
database="Shop")
object2 = object1. # Statement-2
query = '''SELECT * FROM Products WHERE NAME LIKE "A%";'''
object2. (query) # Statement-3
object1.close()

OR
(a) s="Software@Python"
n = len(s)
m=" "
for i in range(0, n):
if (s[i] >= 't' and s[i] <= 'h'):
m = m +s[i].upper()
elif (s[i] >= 'a' and s[i] <= 'w'):
m = m +s[i-1]
elif (s[i].isupper()):
m = m + s[i].lower()
else:
m = m +'#'
print(m)
(b) The code given below reads the following record from the table named
emp and displays only those records who have salary greater than 15000
ENo – integer
Name – string
Desig – string
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 organization. Write the
following missing statements to complete the code:
Statement 1 – to form the cursor object
Statement 2 – to execute the query that extracts records of those

Page 6 of 8
employees whose salary is greater than 15000.
Statement 3- to read the complete result of the query (records whose
salary is greater than 15000) into the object named data, from the table
emp in the database.

import mysql.connector as mysql


def sql_data():

con1=mysql.connect(host="localhost",user="root",password="tiger",
database="organization")
mycursor=_______________ #Statement 1
print("Employees with salary greater than 15000 are : ")
_________________________ #Statement 2
data=__________________ #Statement 3
for i in data:
print(i)
print()
33 Explain the importance of CSV file in file handling. 5
Write a Program in Python that defines and calls the following user defined
functions:
a) ADDITION() – To accept and add data of an staff to a CSV file ‘info.csv’. Each
record consists of a list with field elements as empid, name and salary to store
employee id, employee name and employee salary respectively.
b) COUNT() – To count the number of records present in the CSV file named
‘info.csv’.
OR

Write the difference between binary file and csv file.


Neha is making software on “Items & their prices” in which various records are to
be stored/retrieved in STORE.CSV data file. It consists some records (Item &
Price).
a) AddItem () – To accept data (item and price) as argument and write to a CSV
file ‘info.csv’.
b) Showrecord() – To show all the records present in the CSV file named
‘info.csv’.
SECTION – E

34 An organization ABC Solutions is considering to maintain their employees records 1+1+


using SQL to store the data. As a database administer, Mistry has decided that : 2

• Name of the database - INFOSOFT


• Name of the table - HRDATA
• The attributes of HRDATA are as follows:
ECode – Numeric
EName – character of size 30
Desig – Character of size 15
Remn – numeric
Table: HRDATA

Page 7 of 8
ECode EName Desig Remn
80001 Lokesh Programmer 50000
80004 Aradhana Manager 65000
80007 Jeevan Programmer 45000
80008 Arjun Admin 55000
80012 Priya Executive 35000
a) Identify the attribute best suitable to be declared as a primary key.
b) If one column is added and 1 row is deleted from the table, what will be the
new degree and cardinality of the table HRDATA.
c) Write the statements to :

i. Write command to insert following data in the table:


ECode = 80015, Ename = “Allen” Remn = 43000
ii. Write SQL statement to delete the record of Jeevan from the table HRDATA.

OR (Option for part iii only)


c) Write the statements to :

i) Write SQL statement to increase the Remn of all the employees by 10


percent.
ii) Add a column City in the table with datatype as varchar with 20
characters.

35 AJAY of Class XII is writing a program to search a name in a CSV file “FILE1.csv”. 4
He has written the following code. As a programmer, help him to successfully
execute the given task.

import _________ # Statement 1


f = open("FILE1.csv", _______) # Statement 2
data = ____________ ( f ) # Statement 3
nm = input("Enter name to be searched: ")
for rec in data:
if rec[0] == nm:
print (rec)
f.________( ) # Statement 4

(a) Name the module he should import in Statement 1.


(b) In which mode, MOHIT should open the file to search the data in the file in
statement 2?
(c) Fill in the blank in Statement 3 to read the data from the file.
(d) Fill in the blank in Statement 4 to close the file.

******************

Page 8 of 8

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy