0% found this document useful (0 votes)
88 views13 pages

CS Xii PB QP - Set1

Uploaded by

nehasingh54583
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)
88 views13 pages

CS Xii PB QP - Set1

Uploaded by

nehasingh54583
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/ 13

KENDRIYA VIDYALAYA SANGATHAN, GURUGRAM REGION

(WINTER STATION)
SECOND PRE-BOARD EXAMINATION 2023-24
CLASS : XII MAX. MARKS : 70
SUBJECT : COMPUTER SCIENCE TIME : 3 hrs

General Instructions:
➢ Please check this question paper contains 35 questions.
➢ The paper is divided into 4 Sections- A, B, C, D and E.
➢ Section A, consists of 18 questions (1 to 18). Each question carries 1 Mark.
➢ Section B, consists of 7 questions (19 to 25). Each question carries 2 Marks.
➢ Section C, consists of 5 questions (26 to 30). Each question carries 3 Marks.
➢ Section D, consists of 2 questions (31 to 32). Each question carries 4 Marks.
➢ Section E, consists of 3 questions (33 to 35). Each question carries 5 Marks.
➢ All programming questions are to be answered using Python Language only.

Q. No Question Marks

SECTION A
State True or False:
1 “ Identifiers are names used to identify a variable, function in a 1
program”.
2 In a table in MYSQL database, an attribute P of datatype varchar (25) 1
has the value “Ravimohan”. The attribute Q of datatype char (25) has
value “Himanshi”. How many characters are occupied by attribute P
and attribute Q?
a. 25,9 b. 9,25
c. 8,9 d. 9,8
3 What will be the output of the following statement: 1
print(3/2*2**3+99//11)
a. 21 b. 21.0
c. -21.0 d. Error
4 Select the correct output of the code: 1
Str=”Cumulative Test @ 12”
A=Str.partition(“ “)
a. (‘Cumulative’, ‘ ’, ‘Test @ 12 ’) b. (‘Cumulative’, ‘Test @ 12 ’)
c. (‘Cumulative’, ‘Test’, ‘@ 12 ’) d. (‘Cumulative’, ‘Test @ 12 ’)
5 In MYSQL database, if a table Company, has degree 7 and cardinality 1
4, and another table, Customer has degree 4 and cardinality 6, what
will be the degree and cardinality of the Cartesian product of
Company and Customer?
a. 11,24 b. 24,11
c. 7,4 d. 4,6

6 Divya wants to transfer a file from her mobile phone to her laptop. 1
She uses Bluetooth Technology to connect two devices. Which type of
network will be formed in this case?
a. PAN b. LAN
c. MAN d. WAN

7. Which of the following will add key-value pair for key = “Raju” and 1
value=75 to a dictionary D?
a. D[“75”]=”Raju”
b. D[“Raju”]=”75”
c. D[“Raju”]=75
d. D[“Raju”]=D[“75”]

8 Consider the statements given below and then choose the correct
output from the given options: 1
count="Twenty four"
print(count[-2:2:-2])
Options:
a. ufyn b. rote
c. wnyo d. Error

9 Which of the following statement(s) would give an error during 1


execution of
the following code?
T = (200,300,400,500,800,790)
print(T) #Statement1
print(T[5]+50) #Statement2
print(min(T)) #Statement3
T[4]=750 #Statement4
Options:
a. Statement 1
b. Statement 2
c. Statement 3
d. Statement 4
10 What possible outputs(s) will be obtained when the following code is 1
executed?
import random
p = "MY PROGRAM"
i=0
while p[i] != "R":
l = random.randint(0,3) + 5
print (p[l],end ="_")
i += 1

a. M_M_Y_P b. R_G_A_G

c. P_G_R_Y d. Y_P_G_A

11 Fill in the blank: 1


The MAC address is of ____________ bits.
a. 32
b. 128
c. 48
d. 64

12 Consider the code given below: 1


x=80
def test(p):
_____________ #missing statement
x=p+40
test(120)
print(x)
Which of the following statements should be given in the blank for
#Missing Statement, if the output produced is 160?
Options:
a. global x b. global x=80
c . global p d. global p=80
13 1
When denominator of a division expression is zero, ____ exception is
raised.
14 1
All attribute combinations inside a relation that can serve as primary
key are _______________
(a) Primary Key (b) Foreign Key
(c) Candidate Key (d) Alternate Key

15 1
___________ switching is more reliable than ______________
switching in computer network communication.

16 Which of the following statements correctly explain the function of 1


tell() method?
(a) tells the current position of pointer within the file.
(b) tell the name of file.
(c) move the current file position to a different location.
(d) it changes the file position only if allowed to do so else returns
an error.

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):-Built in functions are predefined in the language that are 1
used directly.

Reasoning(R):-print() and input() are built in functions

18 Assertion(A): Operator * repeats a list by specified number of times. 1

Reasoning(R): Operator * concatenates one list to the end of other list.

SECTION B
19 (i) Expand the following terms: 1+1=
MAC, TCP 2
(ii) The IP address 256.16.12.04 is valid (True/False)

OR
(i) Write one use of POP3.
(ii) Write one difference between Bus and Star topology.
20 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)
21 2
Write definition of a method/function DoubletheOdd( ) to add and
display twice of odd values from the list of Nums.
For example :
If the Nums contains [25,24,35,20,32,41]
The function should display
Twice of Odd Sum: 202

OR

Write a function wordlength() which accepts a string and print each


individual word of it along with its length.
Example:
INDIA is my country.
The wordlength() function should display the output as:
INDIA (5)
is (2)
my (2)
country (7)
22 2
Predict the output of the following python code:
data = [2,4,2,1,2,1,3,3,4,4]
d = {}
for x in data:
if x in d:
d[x]=d[x]+1
else:
d[x]=1
print(d)
23 Write the Python statement for each of the following tasks using 2
BUILT-IN functions/methods only:
(i) To delete an element having value 141 in the list L.
(ii) To check whether a string named test ends with a question
mark(?) or not.

OR

A list named studmarks stores marks of students of a class. Write the


Python command to import the required module and (using built-in
function) to display the average marks from the given list.

24 Mr. Sohan has just created a table named “Product” containing 2


columns Pid as primary key, Pname and Price.
After creating the table, he realized that he has forgotten to add
a column named mfg_date (Manufacturing Date) in the table. Help
him in writing an SQL command to add a column mfg_date of date
data type to the table Product. Thereafter, write the command to
insert the following record in the table:
Pid- P1
Pname- LED TV
Price: 30000
Mfg_date: 2010-11-12

OR

Mahak is working in a database named School, in which she has


created a table named “Student” containing columns SId,

SName, class, and address. After

creating the table, she realized that the attribute, address has to be

deleted from the table and a new attribute Marks of data type

integer has to be added. This attribute Marks cannot be left

blank. Help Mahak write the commands to complete both the tasks.
25 Find and write the output of the following python code: 2
def Change(P ,Q=10):
P=P*Q
Q=Q+P
print( P,"#",Q)
return (Q)
A=5
B=10
A=Change(A)
B=Change(A,B)
print(A,"#",B)
SECTION C
26 What will be the output of the following python program? 3
str = ""
name = "9@Days"
for x in name:
if x in "aeiou":
str+=x.upper()
elif not x.isalnum():
str+="**"
elif x.isdigit():
pass
else:
str+=x.lower()
print(str)

27 Consider the table GAMES given below and write the output of the 3
SQL queries that follow.

PrizeMone
GCode GameName Number y ScheduleDate
101 CaromBoard 2 5000 23-Jan-2004
102 Badminton 2 12000 12-Dec-2003
103 TableTennis 4 8000 14-Feb-2004
105 Chess 2 9000 01-Jan-2004
108 LawnTennis 4 25000 19-Mar-2004

(i) SELECT MAX(ScheduleDate), MIN(ScheduleDate) FROM


GAMES;
(ii) SELECT GCode, GameName FROM GAMES where
GameName LIKE ‘%s’;
(iii) SELECT * FROM GAMES WHERE PrizeMoney > 12000;
28 Write a function showData() in Python to read a text file, Dispaly.txt 3
and displays those lines which begin with the word ‘H’ or ‘h’.

OR

Write a function, vowelCount() in Python that counts and displays the


number of vowels in the text file named Story.txt.

29 Consider the table Personal given below: 3


Table : Booking

ticketno passenger source destination quantity price


10001 ARUN BAN DEL 2 7000
10002 ORAM BAN KOL 3 7500
10003 SUMITA DEL MUM 1 6000
10004 ALI MUM KOL 2 5600
10005 GAGAN MUM DEL 4 5000

Based on the given table, write SQL queries for the following:
(i) Display Ticket no and Passenger Name whose ticket price is
more than 6500.
(ii) Delete the records of Passengers whose destination Name ends
with L.
(iii) Update the value of Price of Ticket (increase price by rs 500)
whose quantity is more than 2.

30 Pramod has created a dictionary containing EMPCODE and SALARY as 3


key value pairs of 5 Employees of Parthivi Constructions.
Write a program, with separate user defined functions to perform the
following operations:

● Push the keys (Employee code) of the dictionary into a stack, where
the corresponding value (Salary) is less than 25000.

● Pop and display the popped content of the stack. For example: If
the sample content of the dictionary is as follows:

EMP={"EOP1":16000, "EOP2":28000, "EOP3":19000, "EOP4":15000,


EOP5":30000}

The output from the program should be: EOP4


SECTION D

31 4

Consider the following tables ACTIVITY and COACH and write SQL
commands.
TABLE : ACTIVITY
ACode ActivityName ParticipantsNum PrizeMoney ScheduleDate
1001 Relay 100×4 16 10000 23-jan-2004
1002 High Jump 10 12000 12-dec-2003
1003 Shot Put 12 8000 14-feb-2004
100 Long Jump 12 9000 01-jan-2004
1008 Discuss Throw 10 15000 19-mar-2004

TABLE : COACH
PCode Name ACode
1 Ahmad Hussain 1001
2 Ravinder 1008
3 Janila 1001
4 Naaz 1003

(i) To display the name of all activities with their Acode in descending
order.
(ii) To display sum of prize money for each of the Participants’ number
groups.
(iii) To display the coach’s name and ACode with name starting with J.
(iv) To display Name of activity, Prize money and Coach name for
which number of participants are greater than 10.

32 Yuvaansh is a Python programmer working in a school. For the Annual 4


Sports Event, he has created a csv file named Result.csv, to store the
results of students in different sports events. The structure of
Result.csv is :
[St_Id, St_Name, Game_Name, Result]
Where
St_Id is Student ID (integer)
ST_name is Student Name (string)
Game_Name is name of game in which student is participating(string)
Result is result of the game whose value can be either 'Won', 'Lost' or
'Tie'
For efficiently maintaining data of the event, Yuvaansh wants to write
the following user defined functions:
Accept() – to accept a record from the user and add it to the file
Result.csv. The column headings should also be added on top of the
csv file.
wonCount() – to count the number of students who have won any
event. As a Python expert, help him complete the task.
SECTION E

33 Magnolia Infotech wants to set up their computer network in the 1*5


Bangalore based campus having four buildings. Each block has a number =5
of computers that are required to be connected for ease of
communication, resource sharing and data security. You are required to
suggest the best answers to the questions i) to v) keeping in mind the
building layout on the campus.

Development HR

Logistics Admin

Number of Computers.
Block Number of computers
Development 100
HR 120
Admin 200
Logistics 110

Distance Between the various blocks


Block Distance
Development to HR 50m
Development to Admin 75m
Development to Logistics 120m
HR to Admin 110m
HR to Logistics 50m
Admin to Logistics 140m
i) Suggest the most appropriate block to host the Server. Also justify
your choice.

ii) Suggest the device that should be placed in the Server


building so that they can connect to Internet Service Provider to
avail Internet Services.

iii) Suggest the wired medium and draw the cable block to block
layout to economically connect the various blocks.

iv) Suggest the placement of Switches and Repeaters in the network


with justification.

v) Suggest the high-speed wired communication medium between


Bangalore Campus and Mysore campus to establish a data
network.

34 (i) Differentiate between tell() and seek() function. 2+3


=5
(ii) A file “sports.dat” contains information about formal event
participants. Write a function that would read contents
from file sports.dat and creates a file named atheletics.dat
copying only those records from sports.dat where the
event name is “Athletics”.
OR
(i) Differentiate between readline() and readlines() function.

(ii) A binary file “student.dat” has structure (admission_no,


name, percentage). Write a function displayrec() that read
contents of the file student.dat and display the details of
those students whose percentage is above 75.
35 (i) Define the term Primary Key with respect to RDBMS. Give one 1+4
example to support your answer. =5

(ii) Kamal wants to write a program in Python to insert the following


record in the table named Employee in MYSQL database, COMPANY:

• Empid (Employee Id )- integer

• Ename (Employee Name) - string

• DOB (Date of birth) – Date

• Salary – integer

Note the following to establish connectivity between Python and

MySQL:

• Username - root

• Password - lion

• Host - localhost

The values of fields Empid, Ename, DOB and Salary has to be accepted
from the user. Help Kamal to write the program in Python.

OR

(i) Give one difference between foreign key and candidate key.

(ii) Balraj has created a table named Student in MYSQL database,


SCHOOL:

• rno(Roll number )- integer

• name(Name) - string

• DOB (Date of birth) – Date

• Fee – float
Note the following to establish connectivity between Python and

MySQL:

• Username - root

• Password - tiger

• Host - localhost

Balraj, now wants to display the records of students whose fee is more
than 5000. Help him to write the program in Python.

-------------

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