Xii Cs Preboard QP Set A Cbessc
Xii Cs Preboard QP Set A Cbessc
Xii Cs Preboard QP Set A Cbessc
5 If a table AA in MySQL database is having 2 rows and 4 columns and the table BB is having
4 rows and 2 columns, the cartesian product of AA and BB will have degree and cardinality as 1
________________________.
6 Mr.Vivek Rana a network administrator of Rana Co. Ltd wants to connect his registered office
located in Mumbai with its head office in Delhi. Suggest an economic way to connect it with 1
reasonable high speed?
8 Consider the string, spstr="Next is #Rio in 24" Find the output of, spstr[-5:3:-2]. 1
9 Consider the Python statement, t=(10,20,30,40,50,60) Identify from the options below that
will result in an error. 1
a) t[4]+44 b) t[4]-44 c) t=t-(70,) d) t=t+(70,)
10 What possible output(s) are expected to be displayed on screen at the time of execution of the 1
program from the following code? Select correct options (can also choose more than one
option) from below.
import random
arr=['10','30','40','50','70','90','100']
L=random.randrange(1,3)
U=random.randrange(3,6)
for i in range(L,U+1):
print(arr[i],"$",end="@")
a) 30 $@40 $@50 $@70 $@90 b)30 $@40 $@50 $@70 $@90 $@
c) 30 $@40 $@70 $@90 $@ d) 40 $@50 $@
12 Identify the missing statement of the following python code if the output produced is 500: 1
a=100
def show( ):
global a
a=100
def invoke( ):
___________ # Missing statement
a=500
show( )
invoke( )
print(a)
13 Look at the code below and identify the type of exception that will be thrown from the options
arr=[10,20,30,40,50,60,70,80,90,100] 1
for i in range(len(arr)+1):
print(arr.pop())
14 Identify the False relational database statement from the options below.
a) Alternate key(s) are the Candidate key(s) not selected as Primary key. 1
b) Foreign key of a table is a Primary key of the table it points to.
c) There can be many Candidate keys in a table.
d) Referential Integrity is enforced by the Alternate keys.
15 Suryansh wants to upload and download files from / to a remote internal server. Write the
name of the relevant communication protocol, which will let him do the same. 1
16 The <filehandle>.seek( 8 ) if applied to a text file stream object moves the read cursor /
pointer : 1
a) 8 characters backwards from its current position
b) 8 characters backward from the end of the file
c) 8 characters forward from its current position
d) 8 characters forwarded from the beginning of the file
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 of A
b) Both A and R are true and 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): The function definition calculate(a, b, c=1,d) will give error. 1
Reason (R): All the non-default arguments must precede the default arguments.
SECTION B
20 The following code that consists of a function and user input part is supposed to return the
factors of a number supplied as a parameter. Since there are errors in both syntax and logical 2
errors it’s not showing the correct result. Your task is to identify and underline the errors.
def problem(n):
myList = ( )
for i in range(1, n+1):
if n // i =0:
myList.append(i)
return myLis
problem(4):
21 CBG is a dictionary that stores the name of the country and their respective Central Banks
Governor’s name as shown below. 2
CBG={"Germany":"JoachimNagel","France":"FrancoisVilleroy de Galhau",
"India":"ShaktikantaDas", "UnitedKingdom":"AndrewBailey",
"UnitedStates":"Jer ome Powell"}
Write a function getNames(CBG) that will take the dictionary as its parameter and will display
only those Governor’s names which are more than 20 characters long including the spaces in
between.
OR
Consider the string G20 below G20="African Union has been included as a member of the
G20". Write a function lenWords(G20) that takes the string as its parameter and returns the
length of each word of the string as a tuple.
23 Write the Python statement for each of the following tasks using built-in functions / methods
only: 2
i) To add another alphabet ‘e’ after the alphabet ‘e’ in the list
L=["C","a","r","e","r","F","a","i","r"]
ii) Check if the string S="eComPhyMat" starts with the alphabet ‘e’.
OR
Determine the most frequent alphabet in the list L=["C","a","r","e","e","r","F","a","i","r"] by
importing appropriate module in Python
24 i) In the existing MySQL table admin with the fields code, gender, designation add the
primary key icode of integer type in the beginning. 2
ii) Ms. Shalini has just created a table named “Employee” containing columns
Ename, Department, Salary. After creating the table, she realized that she had forgotten to add
a primary key column in the table. Help her in writing SQL commands to add a primary key
column empid. Also state the importance of the Primary key in a table.
OR
From the MySQL table admin with the fields icode, code, gender, designation
i) drop the field designation
ii) add a new column department of varchar of any suitable size. Make sure it cannot remain a
blank entry.
SECTION C
27 Consider the table itemmast below, write the output of the MySQL Queries.
3
28 Write a function to read data from a text file ‘DATA.TXT’, and display words which have a
maximum number of vowel characters. 3
OR
A text file contains alphanumeric text (say num.txt).Write a function read_digit () that reads
this text file and prints only the numbers or digits from the file.
29 Look at the table structure itemmast table and write the MySQL Queries: 3
SECTION D
31 Consider the following tables ITEM and CUSTOMER. Write the SQL command for the 4
following statements:
Table: ITEM
I_ID ItemName Manufacturer Price
Table: CUSTOMER
C_ID CustomerName City I_ID
32 Radha Shah is a programmer, who has recently been given a task to write a python code to 4
perform the following CSV file operations with the help of two user defined
functions/modules:
a) CSVOpen() : to create a CSV file called “ books.csv” containing information about books
of 5 records – [Title, Author and Price] with the headings.
b) CSVRead() : to display the records from the CSV file called “ books.csv” .where the field
title starts with 'R'.
SECTION E
Development to Admin 28 m
Admin to Training 32 m
Number of Computers:
Block Number of Computers
Development 90
Admin 40
Training 50
i) Suggest the most appropriate block/location to house the SERVER in the Surajpur center
(out of the 3 blocks) to get the best and effective connectivity. Justify your answer.
ii) Suggest why should a firewall be installed at the Surajpur Center?
iii) Suggest the best wired medium and draw the cable layout (Block to Block) to most
efficiently connect various blocks within the Surajpur Center.
iv) Suggest the placement of the following devices with appropriate reasons:
a) Switch/Hub b) Router
v) Identify the type of network used to connect Surajpur Center and Raipur Center.
34 i) Write the importance of flush( ).
ii) Alia has been given a task of writing a code to create a binary file EMPLOYEE.DAT with 5
employeeid, ename and salary. The file contains 10 records. He now has to update a record
based on the employee id entered by the user and update the salary. The updated record is then
to be written in the file updateemp.dat. The records which are not to be updated also have to
be written to the file updateemp.dat. If the employee id is not found, an appropriate message
should be displayed. Write a user defined function update_data( ) to complete the above task.
OR
i) Explain the process of serialization in the Binary file.
ii)A binary file Book.dat has a structure [bookno,book_name,author,price].Write a function in
Python count_book() to count and return the no.of books whose price is between 100 and 500.