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

Class 12th Computer Science

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
199 views

Class 12th Computer Science

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

KENDRIYA VIDYALAYA SANGATHAN CHANDIGARH REGION

PRE-BOARD -II EXAMINATION - 2024-25

Class: XII Max Marks:70


Subject: COMPUTER SCIENCE (083) Time: 03:00 Hrs
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. QUESTIONS marks
no

1 State True or False : 1


“In Python, tuple is a mutable data type”.

2 Select the correct output of the code : 1


S = "text#next"
print(S.strip("t"))
(A) ext#nex
(B) ex#nex
(C) text#nex
(D) ext#next

3 What will be the output : 1


print(16*5/4*2/5-8)
a) -3.33
b) 6.0
c) 0.0
d) -13

4 Select the correct output of the code : 1


S="Amrit Mahotsav @ 75"
A=S.split(" ",2)
print(A)
(a) ('Amrit', 'Mahotsav', '@', '75')
(b) ['Amrit', 'Mahotsav', '@ 75']
(c) ('Amrit', 'Mahotsav', '@ 75')
(d) ['Amrit', 'Mahotsav', '@', '75']

5 Find the output: 1


A=”MISSISSIPPI”
print(A[:4]+’#’+A[-5:-1])
a) MISSI#SIPPI
b) MISS#SIPPI
c) MISS#IPPIS
d) MISSI#PPIS

6 What will be the output of the following code ? 1


Tuple1=(10,)
Tuple2=Tuple1*2
print(Tuple2)
a) 20
b) (20,)
c) (10,10)
d) Error

7 What will be output of the following code: 1


d1={1:2,3:4,5:6}
d2=d1.get(3)
print(d2)
a) 4 b)3
c) 5 d) 6

8 Select the output of the code: 1


s = “Bring it on”
l = s.split()
s_new = “#”.join([l[0].lower(), l[1], l[2].title()])
print(s_new)
a) bring#it#ON b) bring#it#on
c) Bring#it#On d) bring#it#On

9 If a table which has one Primary key and two candidate keys. How many Alternate keys 1
will this table have?
(A) 1
(B) 2
(C) 3
(D) 4

10 Which of the following modes in Python creates a new file, if file does not exist and 1
overwrites the content, if the file exists ?
(a) r+
(b) r
(c) w
(d) a

11 State whether the following statement is True or False: 1


While handling exceptions in python name of the exception has to be compulsorily added
with except clause

12 What will be the output of the following code? 1


c = 10
def add():
global c
c=c+5
print(c,end='#')
add()
c=12
print(c,end='%')
(A) 15%12#
(B) 15%12#
(C) 15#12%
(D) 12%15#

13 ____________ is used in pattern matching with ( % , _) in where clause to put condition 1

14 Fill in the blank : _________ statement of SQL is used to insert new records in a table. 1
(a) ALTER
(b) UPDATE
(c) INSERT
(d) CREATE

15 In which datatype the value stored is not padded with spaces to fit the specified length, 1
instead it only take up the space they need to store the data.
(A) DATE
(B) VARCHAR
(C) FLOAT
(D) CHAR

16 Which aggregate function will return cardinality of the table 1


(a) sum()
(b) count()
(c) count(*)
(d) max()

17 Which protocol is a set of rules for transmitting data over the internet, and is the basis for 1
the World Wide Web:

(a) pop
(b) http
(c) ftp
(d) smtp
18 Ethernet card is also known as : 1
(a) LIC
(b) NIC
(c) MIC
(d) OIC

19 Fill in the blank : In _________ switching, before a communication starts, a dedicated path 1
is identified between the sender and the receiver.
(a) Packet
(b) Graph
(c) Circuit
(d) Plot

Q20 and Q21 are Assertion(A) and Reason(R) 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

20 Assertion (A): CSV module allows to write a single record into each row in CSV file using 1
writerow() function.
Reason (R): The writerow() function creates header row in csv file by default.

21 Assertion (A): A SELECT command in SQL can have both WHERE and HAVING clauses. 1
Reasoning (R): WHERE and HAVING clauses are used to check conditions, therefore,
these can be used interchangeably.
SECTION B

22 (i) How is list is different from tuple in python? 2


(ii) To which data type partition function covert the string.

23 Give two examples of each of the following: 2


(I)logical operators (II) Relational operators

24 Consider the following list L1 and write Python statement for the following questions: 2
L1=[‘english’,’physics’,’chemistry’,’cs’,’biology’]
(i) (A) To insert subject “maths” as last element
or
(B) To display the list in reverse alphabetical order

(ii) (A) To remove the first element of list


Or
(B) To Find the index position of element ‘cs’

25 What possible outcome will be produced when the following code is executed? 2
import random
value=random.randint(0,3)
fruit=["APPLE","ORANGE","MANGO","GRAPE"]
for i in range(value):
print(fruit[i],end='##')
a) APPLE##

b) APPLE##ORANGE##

c) APPLE## ORANGE##GRAPE##

d) ORANGE##MANGO##APPLE##

26 Rewrite the following code in Python after removing all syntax error(s) and underline each 2
correction done in the code .
define fun1():
30 = num
for k range(0,num):
if k%4=0 :
print(k*4)
else:
print(k+3)

27 (i) A) What constraint should be applied on a table column so that duplicate values are not 2
allowed in that column, but NULL is allowed.
OR
B) What constraint should be applied on a table column so that NULL is not allowed in that
column, but duplicate values are allowed

(II) A) Write an SQL command to remove the Primary Key constraint from a table, named
MOBILE. M_ID is the primary key of the table.
OR
B) Write an SQL command to make the column M_ID the Primary Key of an already
existing table, named MOBILE.

28 i) Expand the following : 2


a) SMTP b) VoIP
ii) Give one disadvantage of Star topology
OR
i) What is a web browser ?
ii) Define the term Telnet

SECTION C

29 Write a function in Python to count the number of lines in a text fie ‘EXAM.txt’ which start 3
with an alphabet ‘T’ .
OR
Write a function in Python that count the number of “can” words present in a text file
“DETAILS.txt”

30 Thushar received a message(string) that has upper case and lower-case alphabet. He want to 3
extract all the upper case letters separately .Help him to do his task by performing the
following user defined function in Python:
a) Push the upper case alphabets from the string into a STACK
b) Pop and display the content of the stack.
For example:
If the message is “All the Best for your Pre-board Examination”
The output should be : E P B A

Or
Consider a list named Nums which contains random integers. Write the following user
defined functions in Python and perform the specified operations on a stack named
BigNums.
(i) PushBig () : It checks every number from the list Nums and pushes all such numbers
which have 5 or more digits into the stack, BigNums.
(ii) PopBig () : It pops the numbers from the stack, BigNums and displays them. The
function should also display "Stack Empty" when there are no more numbers left in the
stack.
For example: If the list Nums contains the following data :
Nums = [213,10025, 167, 254923, 14, 1297653, 31498, 386 ,92765]
Then on execution of PushBig () , the stack BigNums should store :
[10025, 254923, 1297653, 31498, 92765]
And on execution of PopBig () , the following output should be displayed :
92765
31498
1297653
254923
10025
Stack Empty
31 Predict the output of the Python code given below: 3
def calculate(str):
text=''
x=range(len(str)-1)
for i in x:
if str[i].isupper():
text+=str[i]
elif str[i].islower():
text+=str[i+1]
else:
text+='@'
return text
start='Pre-board Exam'
final=calculate(start)
print(final)
OR
Predict the output of the following code :
def Total (Num=10):
Sum=0
for C in range(1,Num+1):
if C%2!=0:
continue
Sum+=C
return Sum
print(Total(4),end="$")
print(Total(),end="@")

SECTION D

32 Consider the table BOOK as given below 4

Book_id Book_name Author_name Publisher Price Quantity


C0001 Fast Cook Lata Kapoor EPB 355 5
F0001 The Tears William First Publ 650 20
Hopkins
T0001 My First c++ Brain & Brooke EPB 350 10
T0002 C++ Brain A.W. Rossaine TDH 350 15
works
F0002 Thunderbolts Anna Roberts First Publ 750 50
The table contains many more records than shown here.

(A) Write the following queries:


i. To show book name, Author name and price of books of “First Publ” Publisher
ii. To list the names of those books whose name starts with F
iii. To Display the names and price from books in ascending order of their prices.
iv. To increase the price of all books of EPB publishers by 50.
OR

(B) Write the output:


i. Select Publisher, sum(quantity) as total_quantity from book group by Publisher;
ii. Select Book_name, Author Name from book where author like '%Kapoor%';
iii. Select * from book where price between 500 and 1000;
iv. Select count(*) from book;

33 A csv file " record.csv " contains the data . Each record consists of a list with field elements 4
as empid, name and sal to store employee id, employee name and employee salary
respectively.
Write user defined functions s in Python that defines the following:
(i) ADD() – To accept and add data of an employee to a CSV file ‘record.csv’.
(ii) COUNTR() – To count the number of records present in the CSV file named
‘record.csv’ whose salary is more than 100000.

34 Aman has been entrusted with the management of some Institution’s Database. He needs to 4
access some information from FACULTY and COURSES tables for a survey analysis.
Help him extract the following information by writing the desired SQL queries as
mentioned below.
Teacher

Posting

(i) To list the names and age of female teachers who are in Mathematics department.
(ii) To display the name teachers who are posted in Agra
(iii) To display the max(date_to_join), min(date_to_join) of teachers
(iv)
(A) To display name, bonus, department for each teacher where bonus is 10% of
salary
Or
(B) To display the Cartesian Product of these two tables.

35 Arushi has created a table named student in MYSQL database, School: 4


•rno(Roll number )- integer
• name(Name) - string
• clas (Clas) – string
• marks – float
Note the following to establish connectivity between Python and MySQL: • Username -
root • Password - 12345 • Host - localhost
i) Arushi, now wants to add record of student by taking data from user. Help arushi to write
the program in Python.
ii) Also write code to display the total number of records present in the table.

SECTION E

36 A binary file “STUDENT.DAT” has structure [admission_number, Name, Percentage]. 5


(I) Write a function to input the data of a candidate and append it in a binary file.
(ii) ) Write a function to increase the percentage of student to 95% whose admission
number is input by the user.

37 Oxford college, in Delhi is starting up the network between its different wings. There are 5
four Buildings named as SENIOR, JUNIOR, ADMIN and HOSTEL as shown below:

i) Suggest the cable layout of connections between the buildings.


ii) Suggest the most suitable place (i.e., building) to house the server of this college,
provide a suitable reason.
iii) Is there a requirement of a repeater in the given cable layout? Why/ Why not?
iv) Suggest the placement of hub/switch with justification.
v) The organisation also has inquiry office in another city about 50-60 km away in hilly
region. Suggest the suitable transmission media to interconnect to college and inquiry
office out of the following: a. Fibre optic cable b. Microwave c. Radio wave
or
What would be your recommendation for enabling live visual communication between
the Admin Office at the Delhi campus and the Mumbai Branch Office from the
following options:
a) Video Conferencing
b) Email
c) Telephony
d) Instant Messaging

You might also like