0% found this document useful (0 votes)
25 views11 pages

PB2 12CS Set1 MS

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)
25 views11 pages

PB2 12CS Set1 MS

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/ 11

KENDRIYA VIDYALAYA SANGATHAN :: HYDERABAD REGION

PRE-BOARD EXAMINATION-2 2024-25


CLASS XII
(MARKING SCHEME)

कक्षा CLASS: XII समय TIME:03 HOURS

विषय SUBJECT: COMPUTER SCIENCE - SET 1 अधिकतम अंक 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


1. B) else
(1 mark for correct answer) (1)
2. D. MG Road Bengaluru
(1 mark for correct answer) (1)
3. A. 7
(1 mark for correct answer) (1)
4. A. Python-123-
(1 mark for correct answer) (1)
5. GLNL
(1 mark for correct answer)
(1)
6. A. t = (10, 20, 30, [1, 2, 3, 4])
(1)
(1 mark for correct answer)
7. C. 9
(1)
(1 mark for correct answer)
8. A. x = 5 + '10'
(1)
(1 mark for correct answer)
9. A. SELECT * FROM Enrollments WHERE EnrollmentDate BETWEEN '2023-
(1)
01-01' AND '2023-12-31';
(1 mark for correct answer)
10. C. Pytho
is (1)
(1 mark for correct answer)
11. D. Value Error Occurred!
(1)
This is the final block
(1 mark for correct answer)
12. D. Error (1)
(1 mark for correct answer)
13. B. Degree refers to the number of attributes, and cardinality refers to the (1)
number of tuples
(1 mark for correct answer)
14. A. Finds the maximum marks greater than 80 in each department (1)
(1 mark for correct answer)
15. C. HAVING (1)
(1 mark for correct answer)
16. A. Duplicates from the result set (1)
(1 mark for correct answer)
17. D. Star (1)
(1 mark for correct answer)
18. A. .com (1)
(1 mark for correct answer)
19. C. High susceptibility to noise (1)
(1 mark for correct answer)
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. A (1)
(1 mark for correct answer)
21. A (1)
(1 mark for correct answer)
Q No Section-B ( 7 x 2=14 Marks) Marks
22. strings are immutable, meaning that once a string is created, its characters
cannot be changed directly.
(1 mark for immutable) (2)
(1 mark for correct explanation)
23. result = 5 * 3 # Multiplies two numbers
print(result) # Output: 15 (2)
(1 mark for correct answer)
text = "Hi! " * 3 # Repeats the string 3 times
print(text) # Output: Hi! Hi! Hi!
(1 mark for correct answer)
24. (i) string.isalnum()
(1 mark for correct answer)
OR
(ii) max(L)
(1 mark for correct answer) (2)
(i) import math
(ii) print(math.ceil(7.21))
(1 mark for correct answer)
OR
(ii) import random
print(random.random())
(1 mark for correct answer)
25. D
(1 mark for correct answer)
Minimum value of j=1 (2)
Maximum value of j=4
(1/2 mark each for correct min and max value)
26 def check_prime(num): (2)
if num <= 1:
return False
elif num == 2:
if num % 2 == 0:
return False
for i in range(2, num):
if num % i == 0:
return False
else:
return True
print(check_prime(7))
(1/2 mark each for 4 mistakes)
27.
(I)
A) CHECK
(1 mark for correct answer)
OR
B) PRIMARY KEY
(2)
(1 mark for correct answer)
(II) A) ALTER TABLE STAFF
MODIFY ContactNumber VARCHAR(15) NOT NULL;
(1 mark for correct answer)
OR
B) ALTER TABLE STAFF DROP ContactNumber;
(1 mark for correct answer)
28. (I)
A. (2)
(i) HTTPS: HyperText Transfer Protocol Secure
(ii)TELNET: Teletype Network
(1 mark each for correct expansion)
B. A major disadvantage of bus topology is that if the main cable
(backbone) fails, the entire network becomes inoperable, disrupting all
communications.
(1 mark for correct disadvantage)
OR
(II)
A. TCP/IP stands for Transmission Control Protocol/Internet Protocol.
(1 mark for correct expansion)

Transmission Control Protocol (TCP):

• Ensures reliable delivery of data between systems.


• Breaks large data streams into packets for transmission and
reassembles them at the destination.
• Provides error-checking, acknowledgment of receipt, and
retransmission of lost packets.

Internet Protocol (IP):

• Responsible for addressing and routing packets to ensure they reach


the correct destination.
• Assigns IP addresses to devices and ensures packets are forwarded
across interconnected networks.

(1 mark for correct explanation)


Q No. Section-C ( 3 x 3 = 9 Marks) Marks
29. def display_unique_words():
with open('STORY.TXT', 'r') as file:
(3)
content = file.read()
words = content.split()
unique_words = []
for word in words:
if len(word) >= 4 and word not in unique_words:
unique_words.append(word)
for word in unique_words:
print(word)

display_unique_words()
(½ mark for correct function header)
(½ mark for correctly opening the file in read mode)
(½ mark for correctly reading and splitting the file)
(½ mark for correct loop statement)
(½ mark for correctly checking the condition)
(1/2 mark for correctly printing the desired word)
OR
def display_words_with_numbers(filename):
with open(filename, 'r') as file:
content = file.read()
words = content.split()
for word in words:
contains_number = False
for char in word:
if char.isdigit():
contains_number = True
break
if contains_number:
print(word)
display_words_with_numbers(‘NUMBER.TXT')
(½ mark for correct function header)
(½ mark for correctly opening the file in read mode)
(½ mark for correctly reading and splitting the file)
(½ mark for correct loop statement)
(½ mark for correctly checking the condition)
(½ mark for correctly printing the desired words)

30. def Add_Book(Book_Stack, New_Book):


Book_Stack.append(New_Book)

def Remove_Book(Book_Stack):

if len(Book_Stack) > 0:
return Book_Stack.pop()
else:
print("No books available")
(3)
return None

def View_Top_Book(Book_Stack):
if len(Book_Stack) > 0:
return Book_Stack[-1]
else:
print("Stack is empty")
return None
(3x1 marks for correct function body; No marks for any function header as
it was a part of the question)
OR
B)
def Push_Qualified_Students(Student_Record):
for roll_no, details in Student_Record.items():
name, _class, marks = details
if marks > 60:
Student_Stack.append([name, _class])

def Pop_All_Students(Student_Stack):
if len(Student_Stack) > 0:
while len(Student_Stack) > 0:
removed_student = Student_Stack.pop()
print("Removed student:", removed_student)
else:
print("Underflow")

def Display_Stack(Student_Stack):
if len(Student_Stack) > 0:
for student in Student_Stack[::-1]:
print(student)
else:
print("Stack is empty")
(3x1 marks for correct function body; No marks for any function header as
it was a part of the question)
31. @E@
@O1
518
(1 mark for each correct line of output)
OR
1 @2 *3 #4 *5 @
1 @2 *3 #4 *
1 @2 *3 #4 *5 @6 * (3)
(1 mark for each correct line of output)
Q No. Section-D ( 4 x 4 = 16 Marks) Marks
32. A)
(I) SELECT * FROM Staff WHERE Name LIKE 'A%' OR Name LIKE 'M%';
(II) SELECT E_ID, Name, Dep, Salary, (Salary * 0.15 + Salary) AS
Total_Salary_With_Bonus FROM Staff WHERE Experience BETWEEN 3
AND 5; (4)
(III) SELECT Department, SUM(Salary) AS Total_Salary FROM Staff GROUP
BY Department;
(IV) SELECT Name FROM Staff WHERE Salary > 50000 ORDER BY Salary
DESC;
(4 x 1 mark for each correct query)

OR

B)
(I)
Dept Number_of _Employees
IT 2
(II)
Name City
Rahul Mumbai
(III)
Emp_ID Name Joining_Date
1005 Vikram 2022-03-18
1001 Rahul 2021-06-15
1003 Arjun 2020-01-10
1002 Sneha 2019-08-22
1004 Meena 2018-11-05

(IV)
Name Salary
Rahul 55000
Sneha 48000
Vikram 54000
(4 x 1 mark for each correct query)
I.
33. import csv
def addStudent():
student_id=int(input(“Enter ID”))
name=input(“enter name”)
marks=eval(input(“enter list of marks”))
with open('STUDENTS.CSV', mode='a', newline='') as file:
writer = csv.writer(file)
writer.writerow([student_id, name, marks])
(4)
ii.
def calculateAverageMarks():
total_marks = 0
total_students = 0
with open('STUDENTS.CSV', mode='r') as file:
reader = csv.reader(file)
for row in reader:
marks = row[2].strip('[]').split(',')
sum_marks = 0
for mark in marks:
sum_marks += int(mark)
total_marks += sum_marks
total_students += 1
if total_students > 0:
average_marks = total_marks / total_students
print("Average Marks of All Students:",average_marks)
else:
print("No student records found.")
(½ mark for opening in the file in right mode)
(½ mark for correctly creating the writer object)
(½ mark for correctly taking input from user)
(½ mark for correctly using writerow function)
(½ mark for correctly creating the reader object)
(11/2 mark for correctly checking the condition)
a) SELECT Store.P_name, Supplier.SNAME FROM Store, Supplier WHERE
34. Store.RATE > 10 and Store.SCODE = Supplier.SCODE;
b) SELECT P_name, (QTY * RATE) AS Total_Value FROM Store ORDER BY
Total_Value DESC;
c) SELECT P_name FROM Store WHERE LASTBUY BETWEEN '2009-01-01' (4)
AND '2009-12-31'; d) SELECT P_name, RATE FROM Store WHERE RATE IN
(SELECT RATE FROM Store GROUP BY RATE HAVING COUNT(*) > 1);
OR
SELECT MAX(QTY) - MIN(QTY) AS Quantity_Difference FROM
Store;
(4x1 mark for each correct query)
import mysql.connector
35.

def displayEmployee():
connection = mysql.connector.connect(
host="localhost",
user="root",
password="emp",
database="Company"
) (4)
cursor = connection.cursor()
select_query = "SELECT EmpID, EmpName, EmpSalary, EmpDepartment
FROM Employee WHERE EmpDepartment = '101'"
cursor.execute(select_query)
rows = cursor.fetchall()
for row in rows:
print(row)
cursor.close()
connection.close()
(½ mark for correctly importing the connector object)
(½ mark for correctly creating the connection object)
(½ mark for correctly creating the cursor object)
(1 mark for correct creation of query)
(½ mark for correctly using fetchall())
(½ mark for correctly displaying the data)
(½ mark for correctly closing the connection object)
SECTION E (2 X 5 = 10 Marks) Marks
Q.No.
(i) (5)
36.
import pickle
def AddBook():
book_id = int(input("Enter Book ID: "))
title = input("Enter Book Title: ")
author = input("Enter Author: ")
qty = int(input("Enter Quantity: "))
book= [book_id, title, author, qty]
file= open("LIBRARY.DAT", "ab")
pickle.dump(book, file)
AddBook()
(II)
def update_BookQuantity():
book_id=int(input(“enter book id”))
new_q=int(input(“enter new quantity”))

try:
file= open('LIBRARY.DAT', 'rb+')
while True:
position = file.tell()
try:
record = pickle.load(file)
if record[0] == book_id:
record[3] = new_q
file.seek(position)
pickle.dump(record, file)

except EOFError:
file.close()

except FileNotFoundError:
print("The file employees.dat does not exist.")
update_BookQuantity()
(1/2 mark for correct function header)
(1/2 mark for importing module)
(1/2 mark for taking input)
(1/2 mark for opening file in appropriate mode)
(1/2 mark for correctly write the data)
(1/2 mark for correct loop)
(1/2 mark for correctly reading the file)
(1 mark for correctly updating the file)
(1/2 mark for closing the file)

i. The server should be placed in the Technology block as it has the (5)
37.
maximum number of computers, following the 80:20 rule, where 80% of
the network's traffic is likely to originate from the block with the most
devices.
(1 mark for correct answer)

ii. Star Topology


(1 mark for correct topology)
iii. a. Repeater should be placed between block Z2 to Z4 as distance is
more than 100m.
(1/2 mark for correct answer)

b. Hub/Switch should be placed in each of these blocks to


efficiently connect all the computers within these blocks.
(1/2 mark for correct answer)

iv VOIP-Voice over Internet Protocol


(1 mark for correct answer)
v. A)WAN. Mumbai and Delhi are located in different cities, which makes
a WAN suitable for covering large geographical areas
OR
B) Firewall
(1 mark for correct answer)

You might also like