GRADE XII - COMPUTER SCIENCE (SET B) (PREBOARD-I) QUESTION PAPER (2024-25)
GRADE XII - COMPUTER SCIENCE (SET B) (PREBOARD-I) QUESTION PAPER (2024-25)
GRADE XII - COMPUTER SCIENCE (SET B) (PREBOARD-I) QUESTION PAPER (2024-25)
(Under the aegis of The Delhi Public School Society, East of Kailash, New Delhi)
PRE-BOARD- I EXAMINATION (2024-25)
CLASS – XII
COMPUTER SCIENCE
ROLL NO.: ___________________ Date – 27.12.24
NAME: ______________________ M.M. – 70
SEC.: _______________________ Time – 3 Hours
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.
● Additional time of 15 minutes will be provided for reading the question paper.
● This question paper consists of 7 printed pages.
18. In SQL, write the query to display the list of tables stored in a database. 1
19. With SQL, how do you select all the records from a table named “Contacts” 1
where the value of the column “FirstName” begins with an “a”?
20. Assertion (A): Positional arguments in Python functions must be passed in 1
the exact order in which they are defined in the function
signature.
Reasoning (R): This is because Python functions automatically assign
default values to positional arguments.
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
21. What is the commonly used unit for measuring the speed of data transmission? 1
Page 2 of 7
Section-B (7x2=14 Marks)
22. The code provided below is intended to swap the first and last elements of 2
a given tuple. However, there are syntax and logical errors in the code.
Rewrite it after removing all errors. Underline all the corrections made.
def swap_first_last(tup)
if len(tup) < 2:
return tup
new_tup = (tup[-1],) + tup[1:-1] + (tup[0])
return new_tup
result = swap_first_last((1, 2, 3, 4))
print("Swapped tuple: " result)
Page 3 of 7
Section-C ( 3 x 3 = 9 Marks)
29. Write a function POP(Book) in Python to delete a Book from a list of Book titles, 3
considering it to act as a pop operation of the Stack data structure.
OR
Write a function PEEK(Book) in Python to look at the top book in a list of book
titles without removing it, mimicking the peek operation of a stack data structure.
30. Write a function in Python that counts the number of “Me” or “My” words 3
present in a text file “STORY.TXT”.
If the “STORY.TXT” contents are as follows:
My first book
was Me and
My Family. It
gave me
chance to be
Known to the
world.
The output of the function should be:
Count of Me/My in file: 4
OR
Write a function AMCount() in Python, which should read each character
of a text file STORY.TXT, should count and display the occurrence of alphabets
A and M (including small cases a and m too).
Example:
If the file content is as follows:
Updated information
As simplified by official websites.
The EUCount() function should display the output as:
A or a:4
M or m :2
31. Write a program to create a tuple of Fibonacci series. 3
OR
Write a program to create a dictionary with numbers as keys and squares as
values.
Section-D (4x4=16 Marks)
32. Navdeep creates a table RESULT with a set of records to maintain the marks 4
secured by students in Sem 1, Sem2, Sem3 and their division. After creation
of the table, he has entered data of 7 students in the table.
33. What is the advantage of using a csv file for permanent storage? 4
Write a Program in Python that defines and calls the following user defined
functions:
a) ADD() – To accept and add data of an employee to a CSV file ‘record.csv’.
Each record consists of a list with field elements as empid, name and mobile to
store employee id, employee name and employee salary respectively.
b) COUNTR() – To count the number of records present in the CSV file named
‘record.csv’.
34. 4
Page 5 of 7
35. 4
a=10
b=5
sum(a,b)
sum(r=5,q=1)
(b) The code given below inserts the following record in the table Student:
RollNo – integer
Name – string
Clas – integer
Marks – integer
Note the following to establish connectivity between Python and MYSQL:
Username is root
Password is tiger
The table exists in a MYSQL database named school.
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 sql_data():
con1=mysql.connect(host="localhost",user="root", password="tiger",
database="school")
mycursor=_________________ #Statement 1
rno=int(input("Enter Roll Number :: "))
Page 6 of 7
name=input("Enter name :: ")
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")
37. Meticulous EduServe is an educational organization. It is planning to setup 5
its India campus at Chennai with its head office at Delhi. The Chennai campus
has 4 main buildings – ADMIN, ENGINEERING, BUSINESS and MEDIA
a) Suggest and draw the cable layout to efficiently connect various blocks of
buildings within the CHENNAI campus for connecting the digital devices.
b) Which network device will be used to connect computers in each block to
form a local area network?
c) Which block, in Chennai Campus should be made the server? Justify your
answer.
d) Which fast and very effective wireless transmission medium should preferably
be used to connect the head office at DELHI with the campus in CHENNAI?
e) Is there a requirement of a repeater in the given cable layout? Why/Why not?
OR
e) What type of network (PAN, LAN, MAN, or WAN) will be set up among the
computers connected in the Chennai campus?
-End-
Page 7 of 7