Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

BANGALORE SAHODAYA SCHOOLS COMPLEX

ASSOCIATION

PRE-BOARD EXAMINATION (2023-2024)


Grade XII- SET I
Date: Max. Marks: 70
Subject: Computer Science (083) Time: 3 Hours
______________________________________________________________________________
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. Three internal
choice is given in Q19,Q21 and Q24
5. Section C has 05 Short Answer type questions carrying 03 marks each. One internal choice is
given in Q28
6. Section D has 02 Long Answer type questions carrying 04 marks each.
7. Section E has 03 questions carrying 05 marks each. Two internal choice is given in Q34 and
Q35.
8. All programming questions are to be answered using Python Language only.

SECTION- A
Sl. No Question M
1 State True or False: 1
“In a Python program, the variable declaration is implicit”
2 Select the DDL command from the following: 1
a) SELECT
b) INSERT
c) DELETE
d) DROP
3 What will be the output of the following statement 1

print(46%2**3+4/11)
a) 6
b)6.0
c)6.3
d)6.5

1
4 Predict the correct output of the code: 1

5 Which of the following will display information about all the employee table, whose 1
names contains second letter as "S"?
(a) SELECT * FROM EMP WHERE NAME LIKE "_S%";
(b) SELECT * FROM EMP WHERE NAME LIKE "%S_";
(c) SELECT * FROM EMP WHERE NAME LIKE "_ _S%";
(d) SELECT * FROM EMP WHERE NAME="S%"
6 Rearrange the following terms in increasing order of data transfer rates. 1
Gbps, Mbps, Tbps, Kbps, bps
7 Which of the following will delete key-value pair for key = “Orange” from a dictionary 1
D1?
a. delete D1("Orange")
b. del D1["Orange"]
c. del.D1["Orange"]
d. D1.del["Orange"]
8 Vamshi creates many tables under the database named “Exam”, now she wants to list 1
out all the tables created in that. Write a SQL query to execute the above condition.
9 Which of the following statement(s) would give an error during execution of the 1
following code?
tup = (20,35,45,50,85,80)
print(tup[1]) #Statement 1
tup[2]=25 #Statement 2
print(tup[3]+50) #Statement 2
print(min(tup)) #Statement 3
tup[4]=80 #Statement 4
Options:
a. Statement 1 & statement 2
b. Statement 2
c. Statement 3
d. Statement 2 & statement 4
10 Out of the following, which is the costliest wired and wireless medium of transmission? 1
Infrared, Coaxial cabel, optical fibre microwave, satellite,twisted pair cable.
11 Identify the type of network 1

2
12 Mr. Soman created a table named “Student” with the fields Rollno, Student_name, Class, 1
and Section. He entered several rows into the table. When he displayed the entered rows,
he found that Rollno’s were duplicated without knowing it. If you were in Soman’s
position, what type of constraints would you apply to avoid the above data redundancy?
13 State whether the following statement is True or False: 1
An exception may be raised even if the program syntax is wrong.
14 The UPDATE SQL clause can 1
a) Update only one row at a time
b) Update more than one row at a time
c) Delete more than one row at a time
d) Delete only one row at a time
15 A client server network is also called as ___________. 1
a) Peer-to-peer network
b) Master-Slave network
c) Dedicated
d) Non-dedicated
16 Mention the modes in which the file pointer is at the end of the line. 1

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) : Default arguments in Python functions should always be placed before 1
non-default arguments in the function signature.
Reasoning(R): Placing default arguments before non-default arguments ensures that the
function can be called without specifying values for the default arguments if needed.

3
18 Assertion (A) : Fiber-optic cables are considered superior to twisted-pair cables for 1
high-speed data transmission.
Reasoning (R) : Fiber-optic cables use light signals to transmit data, which can travel
at higher speeds and over longer distances compared to the electrical signals used in
twisted-pair cables.
SECTION - B
19 i. Write the full form of 1+1=2
a. SMTP
b. PPP
ii. Mention the use of TELNET.
(OR)
i. Expand the following terms:
VOIP, TCP
ii. Mention one difference between PAN and LAN

20 Rao has written a code to input a number and check whether it is 2


prime or not. His code is having errors. Rewrite the correct code and
underline the corrections made.

21 Write a function count(CITIES) in Python, that takes the dictionary, CITIES as an 2


argument and displays the names (in uppercase)of the places whose names are longer
than 5 characters.
(OR)
Write a function, length(words), that takes a string as an argument and returns a list
containing length of each word of a string.
For example, if the words are “ Hello program", the list will have [5,7]
22 Predict the output of the Python code given below: 2

23 Write the Python statement for each of the following tasks using BUILT-IN 1+1=2
functions/methods only:
(i) To insert an element 400 at the fourth position, in the list L1.

4
(ii) To check whether a string named, message ends with a full stop / period or not.

24 Given two tables, 2


Student (Rollno, Admno, name, Class) and Fees (FeeID,Rollno,amount)
Develop an SQL query to combine two tables with the help of foreign key.
(OR)
Ruby is working in a database named CLIENT, in which she created a table named
“ORDER” containing columns Order_ID, Order_name, Amount, DOD. After creating
the table she notice that the customer name is not mentioned. So she decided to add a
new column “C_Name” of string datatype. She also decided that the category DOD is
not required and decided to delete. Help her to write the commands to complete the
task.
25 Predict the output of the following code 2

SECTION- C
26 Deduce the output of the following python code: 3

5
27 A vegetable store “Fresh Stock” maintains the inventory using a SQL table. The table is 3
given below for your view.

i. Name the columns that can be suitable as candidate keys.


ii. Perform insert query
ITEMCODE: 1007, ITEMNAME: GINGER and SCODE=15
iii. Write a query to add a column price into the existing table.
28 Write a function in Python to read a text file, sample.txt and displays those lines which 3
begins with a vowel’.
(OR)
Write a function,Count() in Python that counts and displays the number of words in the
text file named sample.txt.
29 Write the outputs of the SQL queries (i) to (iii) based on the relations Teacher and 3
Posting given below:

i. SELECT Name, Age, Department FROM Teacher WHERE Department


=”History” OR Gender =”F”;
ii. SELECT * FROM Teacher WHERE Age>=40;

6
iii. SELECT Name , Department, Salary WHERE Department NOT IN
Mathematics;
30 Mr. Ajay is a student in grade XII who is a budding programmer in Python. His teacher 3
assigns a task to him: accept a string from the user and create a user-defined function,
INSERT(), that inserts only the uppercase letters present in the string. He also wants to
display the inserted values. Help him by developing a code to perform the above tasks
using data structure.
SECTION- D
31 Write the output of the queries (i) to (iv) based on the table, TECH_COURSE given 1*4=4
below:

i) SELECT DISTINCT TID FROM TECH_COURSE;


(ii) SELECT TID, COUNT(*), MIN(FEES) FROM TECH_COURSE GROUP BY
TID HAVING COUNT(TID)>1;
(iii) SELECT CNAME FROM TECH_COURSE WHERE FEES>15000 ORDER BY
CNAME;
(iv) SELECT AVG(FEES) FROM TECH_COURSE WHERE FEES BETWEEN 15000
AND 17000;
32 Raju is a python programmer working in a leading software company in Chennai. He is 4
assigned with a task to provide the employee name for their annual appreciation with
incentive. For this he created a csv file named “incentive.csv” to store the names of the
employee in different criteria. The structure of the file is:
[Emp_id, Emp_Name, Emp_Designtion,No of Incentives received]
He needs to write a user defined functions that performs the following tasks
Accept() – to accept the details from the user and add it to the file.
Incentive() – to display the name of employee who received incentive more than 3 times.
The file “incentive.csv” should have a proper title.
SECTION - E
33 Granuda consultants are setting up a secured network for their office campus at 1*5=5
Faridabad for their day to day office and web based activities. They are planning to have
connectivity between 3 buildings and the head office situated in Kolkata. Answer the
Question (a) to (e) after going through the bulding poditions in the campus and the other
details which are given below:

7
Distance between the buildings:
• Building Ravi to Jamuna → 120 m
• Building Ravi to Ganga → 50 m
• Building Ganga to Jamuna → 65 m
• Faridabad campus to Head Office → 1460 km

Number of Computers:
• Building Ravi → 25 Nos.
• Building Jamuna → 150 Nos.
• Building Ganga → 51 Nos.
• Head Office → 10 Nos.

a) Suggest the most suitable place to house the server of this organization. Also
give a reason to justify your suggested location.
b) Suggest a cable layout of connections between the buildings inside the campus.
c) Suggest the placement of the following devices with justification:
• Switch
• Repeater
d) The organization is planning to provide a high speed link with its head office
situated in KOLKATA using a wired connection. Which of the following device
will be most suitable for this job?
i. Optical Fiber
ii. Co-axial cable
iii. Ethernet cable
e) The organization is planning to connect its Head office with Faridabad campus.
Which type of network out of LAN, MAN, or WAN will be formed? Justify
your answer.

34 i) Differentiate between “w” and “a” file modes in Python. 2+3


ii) Consider a file, CINEMA.DAT, containing records of the following structure:
[MovieName, Movie_ID, No_of_theatres]

8
Write a function, copy(), that reads contents from the file CINEMA.DAT and copies the
records with Movie name as “ KAALAI” to the file named CINEMA.DAT. The function
should return the total number of records copied to the file CINEMA.DAT.
(OR)
i) Differntiate seek() and tell() methods in python.
ii) A Binary file, CINEMA.DAT has the following structure:
{MNO:[MNAME, MTYPE]}
Where
MNO – Movie Number
MNAME – Movie Name
MTYPE is Movie Type
Write a user defined function, findType(mtype), that accepts mtype as parameter and
displays all the records from the binary file CINEMA.DAT, that have the value of
Movie Type as mtype.
35 a) Write the output of the code given below: 2+3
def printMe(q,r=2):
p=r+q**3
print(p)
#main-code
a=10
b=5
printMe(a,b)
printMe(r=4,q=2)

b) The code given below inserts the following record in the table Student:
Rollno- integer
Name-Varcahr(30)
Class- integer
Marks- Integer

Note the following to establish connectivity between Python and MySQL:


* Username is root
* Password is toor@123
* The table exists in a “stud” database.
* The details (RollNo, Name, Clas and Marks) are to be accepted from the user.
Write the following missing statements to complete the code:
Statement 1 – to form the cursor object
Statement 2 – to execute the command that inserts the record in the table Student.
Statement 3 - to add the record permanently in the database
import mysql.connector as mysql
def sqlData():
con1=mysql.connect(host="localhost",user="root", password="toor@123",
database="stud")
mycursor = ________________ #Statement 1
rno=int(input("Enter Roll Number :: "))
name=input("Enter name :: ")

9
clas=int(input("Enter class :: "))
marks=int(input("Enter Marks :: "))
querry="insert into student values({},'{}',{},{})".format(rno,name,clas,marks)
______________________ #Statement 2
______________________ # Statement 3
print("Data Added successfully")

(OR)

a) Predict the output of the code given below:

b) The code given below inserts the following record in the table Student:
Rollno- integer
Name-Varcahr(30)
Class- integer
Marks- Integer
Note the following to establish connectivity between Python and MySQL:
* Username is root
* Password is toor@123
* The table exists in a “stud” database.
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 students whose marks
are greater than 90.
Statement 3- to read the complete result of the query (records whose marks are greater
than 90) into the object named data, from the table student in the database.

import mysql.connector as mysql


def sql_data():
con1=mysql.connect(host="localhost",user="root",password="toor@123",
database="stud")
mycursor=_______________ #Statement 1
print("Students with marks greater than 90 are : ")

10
______________________ #Statement 2
data=__________________ #Statement 3
for i in data:
print(i)
print()

11

You might also like