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

XII-CS SET A-QP-CbeSSC-DEC 22

The document provides instructions for a Computer Science pre-board examination. It contains 5 sections (A-E) with multiple choice and programming questions. Section A has 18 one-mark questions. Section B has 7 two-mark questions. Section C has 5 three-mark questions. Section D has 3 five-mark questions. Section E has 2 four-mark questions, one with internal choice. All programming questions must be answered in Python.

Uploaded by

ashlisha2005
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)
422 views

XII-CS SET A-QP-CbeSSC-DEC 22

The document provides instructions for a Computer Science pre-board examination. It contains 5 sections (A-E) with multiple choice and programming questions. Section A has 18 one-mark questions. Section B has 7 two-mark questions. Section C has 5 three-mark questions. Section D has 3 five-mark questions. Section E has 2 four-mark questions, one with internal choice. All programming questions must be answered in Python.

Uploaded by

ashlisha2005
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/ 9

A

GRADE:XII PRE – BOARD EXAMINATION (DEC–2022) MARKS:70


SUBJECT: COMPUTER SCIENCE TIME: 3 HRS
General Instructions:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A has 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.

S.NO SECTION-A MARKS


1 Find the invalid identifier from the following
(a) name (b) class (c) section (d) break 1
2 State true or false:
(i) -88.0 is the output of the print(3-10**2+99/11) 1
(ii) Range( ) is also a module function.
3 What is the output of the following code?
a=[1,2,3,4,5]
for i in range(1,5):
a[i-1]=a[i] 1
for i in range(0,5):
print(a[i],end=" ")
(a) 5 5 1 2 3 (b) 5 1 2 3 4 (c) 2 3 4 5 1 (d) 2 3 4 5 5
4 Given the Python declaration s1=”Hello”. Which of the following
statements will give an error? 1
(a) print(s1[4]) (b) s2=s1 (c) s1=s1[4] (d) s1[4]=”Y”
5 Identify the output of the following Python statement:
s=”Good Morning”
print(s.capitalise( ),s.title( ), end=”!”) 1
(a) GOOD MORNING!Good Morning
(b) Good Morning! Good Morning
(c) Good morning! Good Morning!
(d) Good morning Good Morning!
6 What is the output of the functions shown below? 1
min(max(False,-3,-4),2,7)
(a) -3 (b) -4 (c) True (d) False
7 Suppose the context of “Rhymes.txt” is
Hickory Dickory Dock 1
The mouse went up the clock
What will be the output of the following Python code?
f=open(“Rhymes.txt”)
l=f.readlines()
x=[“the”,”ock”]
for i in l:
for w in i.split():
if w in x:
print(w,end=”*”)
(a) the* (b) the*the* (c) Dock*the*clock* (d) error
8 Which of the following statement is not correct?
(a) We can write content into a text file opened using ‘w’ mode
(b) We can write content into a text file opened using ‘w+’ mode
(c) We can write content into a text file opened using ‘r’ mode
(d) We can write content into a text file opened using ‘r+’ mode 1
9 ___________ is a protocol that allows to send/upload email message from 1
local computer to an email server.
10 What will the following code do?
dict={“Phy”:94,”Che”:70,”Bio”:82,”Eng”:95}
dict.update({“Che”:72,”Bio”:80}) 1
(a) It will create new dictionary as dict={“Che”:72,”Bio”:80} and old dict
will be deleted
(b) It will throw an error as dictionary cannot be updated
(c) It will simply update the dictionary as
dict={“Phy”:94,”Che”:72,”Bio”:80, “Eng”:95}
(d) It will not throw any error but it will not do any changes in dict
11 Command to remove the row(s) from table student is 1
(a) drop table student; (b) drop from student;
(c) remove from student; (d) delete from student;
12 Which SQL command is used to add a new attribute in a table? 1
13 The following SQL command 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
14 In order to open a connection with MySQL database from within Python 1
using mysql.connector package, ________ function is used.
(a) open( ) (b) database( ) (c) connect( ) (d) connected( )
15 The aggregate functions can only be used in the select list or _______ 1
clause of a select query.
16 __________ counts only those rows that contain a value; it ignores all null 1
values in the field.
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): The readline( ) method reads one complete line from a text 1
file.
Reason(R): The readline( ) method reads one line at a time ending with a
newline(\n). It can also be used to read a specified number (n) of bytes of
data from a file but maximum up to the newline character(\n)
18 Assertion(A): Keyword arguments are related to function calls. 1
Reason(R): When you use keyword arguments in a function call, the caller
identifies the arguments by the values passed.
S.NO SECTION-B MARKS
19 Rewrite the following Python program after removing all the syntactical 2
errors (if any), underlining each correction:
x=input(“Enter a number”)
if x % 2=0:
print x, “is even”
else if x<0:
print x, “should be positive”
else;
print x “is odd”
20 Why do we need to network our systems?
(OR) 2
How is Coaxial cable different from Optical Fibre?
21 (a) Find the output generated by the following code: 1
a=5
b=10
a+=a+b
b*=a+b
print(a,b)
(b) Answer the following questions from the following code: 1
num_list=[“One”,”Two”,”Three”,”Four”]
for c in num_list:
print(c)
(i) What will be the output of the above code?
(ii) How many times the loop executed?
22 What is the similarity and difference between UNIQUE and PRIMARY 2
KEY constraints?
23 (a) What is the difference between HTTP and FTP? 2
(b) Expand the following: SLIP, PPP
24 Determine the output of the following code fragments:
def determine(s):
d={“UPPER”:0, ”LOWER”:0}
for c in s:
if c.isupper( ):
d[“UPPER”]+=1 2
elif c.islower( ):
d[“LOWER”]+=1
else:
pass
print(“Original String:”,s)
print(“Upper case count:”, d[“UPPER”])
print(“Lower case count:”, d[“LOWER”])
determine(“These are HAPPY Times”)
(OR)
Find and write the output of the following Python code:
def fun(s):
k=len(s)
m=” “
for i in range(0,k):
if (s[i].isupper( )):
m=m+s[i].lower( )
elif s[i].isalpha( ):
m=m+s[i].upper( )
else:
m=m+’bb’
print(m)
fun(‘school2@com’)
25 Write the full forms of DDL and DML. Write any two commands of DML 2
in SQL.
(OR)
What is the use of GROUP BY clause? Give example.
S.NO SECTION-C MARKS
26 Consider the following tables: CONSIGNOR and CONSIGNEE 3
Table: CONSIGNOR
CnorID CnorName CnorAddress City
ND01 R.Singhal 24, ABC Enclave New Delhi
ND02 Amit Kumar 123, Palm Avenue New Delhi
MU15 R Kohli 5/A, South Street Mumbai
MU50 S Kaur 27-K, Westend Mumbai

Table: CONSIGNEE
CneeID CnorID CneeName CneeAddress CneeCity
MU05 ND01 Rahul Kishore 5, Park Avenue Mumbai
ND08 ND02 P Dhinga 16/J, Moore Enclave New Delhi
KO19 MU15 A P Roy 2A, Central Avenue Kolkata
MU32 ND02 S Mittal P 245, AB Colony Mumbai
ND48 MU50 B P Jain 13, Block D, A Vihar New Delhi
Give output for the following SQL queries:
(i) SELECT A.CnorName, B.CneeName
FROM Consignor A, Consignee B
WHERE A.CnorID=B.CnorID AND B.CneeCity=’Mumbai’;
(ii) SELECT CneeName, CneeAddress
FROM Consignee
WHERE CneeCity NOT IN(‘Mumbai’, ‘Kolkata’);
(iii) SELECT DISTINCT CneeCity FROM Consignee
27 Write a function Show_words( ) in python to read the content of a text file 3
‘NOTES.TXT” and display the entire content in capital letters. Example if
the file contains:
“This is a test file”
Then the function should display the output as:
THIS IS A TEST FILE
(OR)
Write a function countmy( ) in python to read the text file “DATA.TXT”
and count the number of times “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”
28 Consider the following tables WORKER and PAYLEVEL and answer the following 3
parts of this question:
Table: WORKER
ECODE NAME DESIG PLEVEL DOJ DOB
11 Radhe Shyam Supervisor P001 13-09-2004 23-08-1981
12 Chander Nath Operator P003 22-02-2010 12-07-1987
13 Fizza Operator P003 14-06-2009 14-10-1983
15 Ameen Ahmed Mechanic P002 19-12-2005 13-03-1983
18 Sanya Clerk P002 19-12-2005 09-06-1983
Table: PAYLEVEL
PLEVEL PAY ALLOWANCE
P001 26000 12000
P002 22000 10000
P003 12000 6000
Give the output for the following SQL queries:
(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.CODE<13
29 Write a function stats( ) that accepts a filename and reports the file’s longest 3
line.
30 Write Addnew(Book) and Remove(Book) functions in python to add a new 3
book and remove a book from a List of books, considering them to act as
PUSH and POP operations of the data structure Stack.
(OR)
Write a function called letter_freq(my_list) that takes one parameter, a list
of strings(mylist) and returns a dictionary where the keys are the letters
from mylist and the values are the number of times that letter appears in the
mylist, e.g.,if the passed list is as:
wlist=list(“aaaaabbbbcccdde”)
then it should return a dictionary as{‘a’:5,’b’:4,’c’:3,’d’:2,’e’:1}
S.NO SECTION-D MARKS
31 Learn Together is an educational NGO. It is setting up its new campus at 5
Jabalpur for its web-based activities. The campus has four compounds as
shown in the diagram below:

Centre to centre distance between various compounds as per architectural


drawing (in m) is as follows:
BLOCK DISTANCE
Main Compound to Resource Compound 110 m
Main Compound to Training Compound 115 m
Main Compound to Finance Compound 35 m
Resource Compound to Training Compound 25 m
Resource Compound to Finance Compound 135 m
Training Compound to Finance Compound 100 m
Expected number of computers in each compound are as follows:
BLOCK NO.OF COMPUTERS
Main Compound 5
Resource Compound 15
Training Compound 150
Finance Compound 20
(i)Suggest a cable layout of connections between the compounds.
(ii) Suggest the most suitable place (i.e. compound) to house the server for
this NGO. Also, provide a suitable reason for your suggestion.
(iii) Suggest the placement of the following devices with justification:
(a) Repeater (b) Hub/Switch
(iv) The NGO is planning to connect its international office situated in
Mumbai, which out of the following wired communication link, will you
suggest for a very high-speed connectivity?
(a) Telephone analog line (b) Optical fibre (c) Ethernet cable.
(v) Suggest a device / software to be installed in the Jabalpur campus to
take care of data security.
32 (a) Write the output of the code given below: 2+3
def evn(l):
enum=” “
for n in range(len(l)):
if n%2==0:
enum+=l[n]
elif n%3==0:
enum+=l[n].upper( )
return enum
print(evn([‘a’,’b’,’r’,’a’,’c’,’a’,’d’,’a’,’b’,’r’,’a’]))
(b) The given program is used to connect with MYSQL and show the name
of all the database available in MYSQL server. You are required to
complete the statements so that the code can be executed properly.
import mysql.connector
db=mysql.connector.________(i) fill the statement with appropriate method
(host=”localhost”,user”root”,password=”smsmb”)
cur=db.cursor( )
cur.execute(“_______;”) (ii) command to display all the database name
print(cur.________) (iii) method to extract all the required from the cursor
(OR)
(a) Predict the output of the code given below:
a=10
b=20
def change( ):
global b
a=45
b=56
change( )
print(a)
print(b)
(b) Write a function to find the power of a number.
33 (a) Write a function in Python that counts the number of “Me” or “My” 5
words present in a text file “STORY.TXT”. If the “STORY.TXT” contents
are as follows:
My first book was Me and My family.
It gave me chance to be known to the world.
The output of the function should be:
Count of Me/My in file:
(b) Give one point of difference between a binary file and a CSV file.
(OR)
(a) What are functions? Give its advantages.
(b) Write a function in Python PUSH(Arr), where Arr is a list of numbers.
From this list push all numbers divisible by 5 into a stack implemented by
using a list. Display the stack if it has at least one element, otherwise
appropriate error message.

S.NO SECTION-E MARKS


34 In a database High sports there are two tables: students and sports with the 4
instances given below:
Table: STUDENTS
ADMNO NAME CLASS GRADE RNO ADDRESS PHONE
1211 MEENA 12A D 4 A-26 3245678
1212 VANI 10A D 1 B-25 5456789
1213 MEENA 12B A 1 NULL NULL
1214 KARISH 10B B 3 AB-234 4567890
Table: SPORTS
ADMNO GAME COACHNAME GRADE
1215 CRICKET MR.RAVI A
1213 VOLLEYBALL MR.AMANDEEP B
1211 VOLLEYBALL MR.GOVARDHAN A
1212 BASKETBALL MR.TEWARI B
Write the SQL queries for the following statements:
(i) To display name and game of those students whose address is available
in students table.
(ii) To delete a column phone from the table students.
(iii) To display names of those students who are studying in class 12 and
their corresponding coach names is their admission number.
(OR) (Option for part iii only)
(iii) To count the number of students who play volleyball.
35 Krishna of class 12 is writing a program to read the details of Sports 4
performance and store in the csv file “games.csv” delimited with a tab
character. As a programmer, help him to achieve the task.
import csv
f=open(“games.csv”,”a”)
sobj=csv.________(f.delimiter=’\t’) # Line 1
sobj.writerow([‘Games’,’Competitions’,’Prizes’])
ans=’y’
i=1
while ans==’y’:
print(“Record:”i)
game= input(“Game Name:”)
comp=int(input(“No.of participants:”))
prize=int(input(“Prizes:”))
rec=_________ # Line 2
sobj._________ # Line 3
i+=1
ans=input(“Do you want to continue?(y/n):”)
f.________ # Line 4
(a) Line 1: To create an object to enable to write in the csv file
(b) Line 2: To store the data in list
(c) Line 3: To write a record
(d) Line 4: To close the file

You might also like