0% found this document useful (0 votes)
17 views12 pages

12 CS - S2 KVP

The document is a pre-board examination paper for XII Computer Science, containing 37 questions divided into five sections with varying marks. It includes multiple-choice questions, programming tasks, and SQL queries, primarily focused on Python programming and database concepts. The exam has a total duration of 3 hours and a maximum score of 70 marks.

Uploaded by

a46459050
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)
17 views12 pages

12 CS - S2 KVP

The document is a pre-board examination paper for XII Computer Science, containing 37 questions divided into five sections with varying marks. It includes multiple-choice questions, programming tasks, and SQL queries, primarily focused on Python programming and database concepts. The exam has a total duration of 3 hours and a maximum score of 70 marks.

Uploaded by

a46459050
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/ 12

12PB24CS01

KENDRIYA VIDYALAYA SANGATHAN ERNAKULAM REGION


PRE-BOARD EXAMINATION (2024-25)
XII – COMPUTER SCIENCE (083)
Time allowed: 3 Hours Maximum Marks: 70

General Instructions:
● This question paper contains 37 questions.
● All questions are compulsory. However, internal choices have been provided in some
questions. Attempt only one of the choices in such questions
● The paper is divided into 5 Sections- A, B, C, D and E.
● Section A consists of 21 questions (1 to 21). Each question carries 1 Mark.
● Section B consists of 7 questions (22 to 28). Each question carries 2 Marks.
● Section C consists of 3 questions (29 to 31). Each question carries 3 Marks.
● Section D consists of 4 questions (32 to 35). Each question carries 4 Marks.
● Section E consists of 2 questions (36 to 37). Each question carries 5 Marks.
● All programming questions are to be answered using Python Language only.
● In case of MCQ, text of the correct answer should also be written.

Q.No Section-A (21 x 1 = 21 Marks) Marks


State True or False:

The data type of a variable in Python can be modified during the execution of the
1
1 program.
Select the correct output of the code:
s="GOOD MORNing"
print(s.capitalize(),s.title(),s.swapcase(),end="!")
a) Good morning Good Morning good MORNing!
b) Good morning Good Morning good mornING
c) Good morning! Good Morning! good mornING!
d) Good morning Good Morning good mornING!
2 1
What will the output of the following expression in Python?
print(2**3**2//8)
(a)64.0 (b)64 (c)8 (d)None Of These
3 1
What will be the output for the following Python statement?
D1={'Rahul':295, 'Rithu':15, 'Mishel':64, 'Nihan':120}
print('Mishel' in D1, 15 in D1, sep="#")
(a)True#False (b) True#True
(c) False#True (d) False#False
4 1
Select the correct output of the code:
Str="I will Succeed"
lis=Str.split(" ")
print(lis[-1])
(a) I
(b) will
(c) Succeed
(d) ”I will Succeed”
5 1
Select the correct output of the code:
Str= "INCREDIBLE INDIA @ 75"
S=Str.partition(" ")
print(S)
a. (@ 75' 'INCREDIBLE', ' ', 'INDIA,)
b. ('INCREDIBLE', ' @', 'INDIA , 75')
c. ('', ' ', 'INCREDIBLE INDIA @ 75')
d. ('INCREDIBLE', ' ', 'INDIA @ 75')

6 1
Which one of the following is the function to get list of keys from a dictionary
dict in python?
a. dict.getkeys()
b. dict.getvalues()
c. dict.keys()
d. None Of These
7 1
What is the correct way to add an element to the end of a list in Python?
a. list.add(element)
8 b. list.append(element) 1
c. list.insert(element)
d. list.extend(element)

In the relational model, relationships among relations/table are created by using


_______ keys.
(a) primary (b) alternate (c) candidate (d) foreign
9 1
The correct statement to place the file handle fp1 to the 10th byte from the current
position is:
(a) fp1.seek(10) (b) fp1.seek(10, 0)
(b) fp1.seek(10, 1) (d) fp1.seek(10, 2)
10 1
Which of the following statements is false?
a. A try-except block can have more than one except statement
b. One block of except statement cannot handle multiple exceptions
c. The finally block is always executed
d. When 1 == "1" is executed, no exception is raised
11 1
Predict the out put
X = 25
def funct(X):
X = 50
X+=10
funct (X)
X=X+5
print("X is now:" ,X)
a) X is now: 50 b) X is now: 25 c) X is now: 30 d) X is now:60
12 1
Mandatory arguments required to connect any database from Python are:
(a) Username, Password, Hostname, Database name, Port
(b) Username, Password, Hostname
(c) Username, Password, Hostname, Database Name
13 (d) Username, Password, Hostname, Port 1
Which Python function is used for displaying only one result set from SQL table in a
database?
a. fetch1()
b. fetchno()
c. fetchall()
d. fetchone()
14 1
Which of the following SQL commands will change the attribute datatype of an
existing table?
(a) insert
(b) update
(c) alter
(d) change
15 1
Which of the following aggregate functions ignore NULL values?
(a) COUNT (b) MAX (c) AVERAGE (d) All of these
16 1
Fill in the blank:
_________ protocol provides access to services hosted on a remote computer.
a. FTP
b. PPP
c. Telnet
d. SMTP
17 1
_______ is a device that forwards data packets along networks.
(a) Gateway (b) Modem (c) Router (d) Switch
18 1
19 TCP/IP stands for
a) Transmission Communication Protocol / Internet Protocol
b) Transmission Control Protocol / Internet Protocol
c) Transport Control Protocol / Interwork Protocol
d) Transport Control Protocol / Internet Protocol

1
20 Assertion(A): A function is block of organized and reusable code that is used to
perform a single, related action.
Reasoning(R): Function provides better modularity for your application and a high
degree of code reusability.
(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
1
21 Assertion(A) : Delete command is used to remove rows or records from table.
Reason(B) : This command is used to remove records along with structure of the
table from database
(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
1
Section-B ( 7 x 2=14 Marks)
Write a suitable Python statement for each of the following tasks
using built-in functions/methods only:
i To delete an element ‘Apple’:100 from Dictionary Fruits.
ii To display words in a string S in the form of a list
22 2
What will be the out put of the following code
L = [10,15,20,25]
G = 10
def Change(X):
global G
N=len(X)
for i in range(N):
X[i] += G
Change(L)
for i in L:
23 print(i,end='@') 2
What will be the output of the following code?
L=["Sunday" , "Monday", "Tuesday", "Wednesday"]
print(len(L)/2*len(L[2]))
24 2
What possible outputs(s) will be obtained when the following code is executed?

import random
Signal=['Stop','Wait','Go']
for K in range (2,0,-1):
R=random.randrange(K)
print(Signal[R], end='#')

a. Stop#Go#
b. Wait#Stop#
c. Go#Stop#
d. Go#Wait#
25 2
In the python code given below is not giving the expected output . There are some
errors in it. Rewrite the correct code and underline the corrections made.
DEF execmain():
x = input(“Enter a number ”;)
if (abs(x)=x):
print (“You entered a positive number”)
else:
x=*-1
print (“Number made positive :”)
execmain()
26 2
What is a NOT NULL constraint in SQL? Give example to illustrate.

OR

What is the use of BETWEEN in Sql Queries


27 2
28 List the Advantages of Twisted Pair cable in networking 2
OR
List the advantages of Star topology

Section-C ( 3 x 3 = 9 Marks)
Write a function in python to count the number lines in a text file ‘Woods.txt’ which 3
is starting with an alphabet ‘W’ or ‘H’. If the file contents are as follows:

Whose woods these are I think I know.


His house is in the village though.
He will not see me stopping here
To watch his woods fill up with snow.
The output of the function should be:
W or w : 1
H or h : 2
OR
Write a user defined function countwords( ) to display the total number of words present
in the text file “Quotes.Txt”.

If the text file has the following data written in it:


Living a life you can be proud of doing your best Spending your time with people and
activities that are important to you Standing up for things that are right even when it’s
hard becoming the best version of you

The countwords() function should display the output as: Total number of words : 40
29
A list contains following record of a customer: 3
[Customer_name, Phone_number, City]
Write the following user defined functions to perform given operationson the stack
named ‘status’:
(i) Push_element() - To Push an object containing name and Phone number of
customers who live in DELHI to the stack
(ii) Pop_element() - To Pop the objects from the stack and display them. Also, display
“Stack Empty” when there are no elements in the stack.

(iii)Top_element() This function displays the topmost element of the stack without
deleting it. If the stack is empty, the function should display 'None'.
30 For example:
If the lists of customer details are:
[“AJEY”, “5588996633”,”DELHI”]
[“AMITH”, “9988776633”,”CHENNAI”]
[“MINU”,”7799664488”,”BENGALURU”]
[“ROHAN”, “8899446622”,”DELHI”]

The stack should contain


[“AJEY”, “5588996633”,”DELHI”]
[“ROHAN”, “8899446622”,”DELHI”]

The output should be:


[“AJEY”, “5588996633”,”DELHI”]
[“ROHAN”, “8899446622”,”DELHI”]
Stack Empty

[“AJEY”, “5588996633”,”DELHI”]
3
Predict the output of the Python code given below:
L=[1,2,3,4,5]
Lst=[]
for i in range(len(L)):
if i%2==1:
t=(L[i],L[i]**2)
Lst.append(t)
print(Lst)

OR

Predict output of the following code fragment –


tuple1 = (11, 22, 33, 44, 55 ,66)
list1 =list(tuple1)
new_list = []
for i in list1:
if i%2==0:
new_list.append(i)
new_tuple = tuple(new_list)
31 print(new_tuple)
Section-D ( 4 x 4 = 16 Marks)
(a) Write the output of the queries (i) to (iv) based on the table 4

Table: STAFF
EID Name DOB DOJ Salary Grade

E01 VINAY 1990-07-12 2015-01-21 85000 A


E02 AMITH 1992-06-21 2015-02-01 13500 B
E03 MANYA 1996-11-15 2018-08-19 55500 A
E04 ROSHAN 1991-10-25 2018-10-19 85000 C
E05 MINU 1993-12-16 2018-10-19 95000 A

i SELECT NAME, Grade FROM STAFF ORDER BY NAME DESC;


ii SELECT NAME, SALARY FROM STAFF WHERE NAME LIKE 'A%';
iii SELECT NAME, DOJ FROM STAFF WHERE SALARY BETWEEN
52000 AND 85000;

iv SELECT * FROM STAFF WHERE Grade = 'A';


32
Write a Program in Python that defines and calls the following user defined functions: 4
(i) add() – To accept and add data of a toystore to a CSV file ‘toydata.csv’.
Each Toy data record consists of a list with field elements as tid,
tname and tprice to store toy id, toy name and toy price respectively.
ie TD=[tid,tname,tprice]

(ii) search()- To display the records of the toys whose price is more than
500.
33
Write SQL queries for (i) to (iv) based on the tables PASSENGER and FLIGHT 4
given below:

Table: PASSENGER
PNO NAME GENDER FNO
1001 Suresh MALE F101
1002 Anita FEMALE F104
1003 Harris MALE F102
1004 Nita FEMALE F103

34
Table: FLIGHT
FNO START END F_DATE FARE
F101 MUMBAI CHENNAI 2021-12-25 4500
F102 MUMBAI BENGALURU 2021-11-20 4000
F103 DELHI CHENNAI 2021-12-10 5500
F104 KOLKATA MUMBAI 2021-12-20 4500
F105 DELHI BENGALURU 2021-01-12 5000

i) Write a query to display the NAME, corresponding FARE and


F_DATE of all passengers who have flight to start from “DELHI”.

ii) Insert the following record into the table: Passenger.


PNO-1005, NAME-Kavi, GENDER-FEMALE, FNO-F104

iii) Write a query to delete the records of flights which ends at ”MUMBAI”.

iv) (A).Add a column REMARKS in FLIGHT table with data type as


varchar with 30 characters.
OR
(B) What is the Degree and Cardinality of the Flight Table

A table, named EMPLOYEE , in COMPANY database, has the following structure: 4


Attribute Datatype
Empno Int(4)
Name Varchar(15)
Desig Varchar(10)
Salary Flaot

Write the following Python function to perform the specified operation: Insert_Show():
To input details of an item and store it in the table EMPLOYEE. The function should
then retrieve and display all records from the EMPLOYEE table where the Salary is
greater than 50000. Assume the following for Python-Database connectivity: Host:
localhost, User: root, Password: 123
35
SECTION E (2 X 5 = 10 Marks)
i. Mention any two differences between binary files and csv files? 5

36 ii.Consider a file AIR.DAT containing multiple records. The


structure of each record is as shown below:
[Fno, FName, Fare, Source, Destination]
Write a function COPY_REC() in Python that copies all thoserecords from AIR.DAT
where the source is DELHI and the destination is MUMBAI, into a new file
RECORD.DAT

iii Consider a Binary file BOOK.DAT containing a dictionary having multiple


elements. Each element is in the form BNO:[BNAME,BTYPE,PRICE] as key:value
pair where BNO – Book Number BNAME – Book Name BTYPE - Book Type PRICE
– Book price
Write a user-defined function, findBook(price), that accepts price as parameter and
displays all those records from the binary file BOOK.DAT which has a book price more
than or equal to the price value passed as a parameter.

Indian School, in Delhi is starting up the network between its different wings. There 5
are Four Buildings named as SENIOR, JUNIOR, ADMIN and HOSTEL as shown
below:

CRICKET ADMIN SENIOR


GROUND
JUNIOR HOSTEL

And also they have a Cricket ground 2000 KM away from the school wing.

The distance between various buildings is as follows:

ADMIN TO SENIOR 200m


ADMIN TO JUNIOR 150m
ADMIN TO HOSTEL 50m
SENIOR TO JUNIOR 250m
SENIOR TO HOSTEL 350m
JUNIOR TO HOSTEL 350m
PLAYGROUND TO SCHOOL WING 2000 Kilometer
37
Number of Computers in Each Building:

SENIOR 130
JUNIOR 80
ADMIN 160
HOSTEL 50

1) Suggest the cable layout of connections between the buildings and the
topology thus formed (school wings only).

2) Suggest the most suitable place (i.e. building) to house the server of this
school, provide a suitable reason.

3) Suggest the placement of the following devices with justification.


i) Repeater
ii) Hub /Switch
4) The organization also has Inquiry office in another city about 50-60 Km away in a
Hilly Region. Suggest the suitable transmission media to interconnect the school
and Inquiry office out of the following
o Fiber Optic Cable
o Microwave
o Radio wave
What would be the type of network thus formed?

5) Which fast and very effective wireless transmission medium should preferably
be used to connect the school wing at Delhi with the Cricket ground for live
Telecast?

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

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