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

23-CS-MS-4

J

Uploaded by

Satyam Sah
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)
28 views

23-CS-MS-4

J

Uploaded by

Satyam Sah
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, Kolkata Region


वितीय प्री - बोडड परीक्षा / 2nd Pre-Board Examination 2024-25

कक्षा/ Class – XII अविकतम अंक/ Maximum Mark – 70


विषय/ Subject - संगणक विज्ञान/ Computer Science समय / Time - 03 घंटे/ 03 Hours
MARKING SCHEME

Q No. SECTION A (21X1=21) Marks


1. true - valid (1)
_123 - valid

1/2 mark for correct identification of each type


2. A) tuple
(1)

1 mark for correct answer


3. B) a or a'
Always evaluates to be True because 1 or 0 / 0 or 1 will always produce 1 (1)

1 mark for correct answer


4. (A) ['Sch', ' ', 'l art c', 'mpetiti', 'n']
(1)

1 mark for correct answer


5. o
(1)
(1 mark for correct answer)
6. Only line 3 will give error because tuple can't be concatenated with integer
(1)
1/2 mark for identifying correct line of error
1/2 mark for justification
7.
(C)List cannot be kept as key (1)
(1 mark for correct answer)
8.
(C)Returns another list in ascending order by default. (1)
(1 mark for correct answer)
9. (A) True
(1)
1 mark for correct answer.
10.
(B)First 2 characters replaced by KV. (1)
(1 mark for correct answer)
11.
True (1)
(1 mark for correct answer)
12.
C) 92#10% (1)
(1 mark for correct answer)
13. (1)
unique key
(1 mark for correct answer)

14.
(A)12 (1)
(1 mark for correct answer)

15.
(B)Alter table <tabname> drop <colname> (1)
(1 mark for correct answer)

16.
(D)Both A and B (1)
(1 mark for correct answer)

17.
(A)TELNET (1)
(1 mark for correct answer)

18.
(B)Hub (1)
(1 mark for correct answer)

19.
MAN (1)
(1 mark for correct answer)

20.
(D)A is False but R is True (1)
(1 mark for correct answer)

21.
(A)Both A and R are true and R is the correct explanation for A (1)
(1 mark for correct answer)
Q No. SECTION B (7 X 2 =14) Marks
22. a. L [-1] = L [-1] +(90,98)
Will run, and 90,98 will be concatenated with the existing tuple and will replace
the last element
(2)
b. L [-1] [0] = 890
Will not run since we are trying to change the value of tuple here.

(1 x 2 = 2 Mark for selecting correct answer)


23.
a) print(L.count(12))
b) print(L.index(91) (2)
(1 x 2 = 2 Mark for selecting correct answer)

24. def lenwords(St):


t=()
li=St.split() +1/2 for using .split()
for i in li: +1/2 for iteration (2)
t=t+(len(i),) +1/2 for using len()
+1/2 for correctly framing the tuple. Students may
take a list to append and convert list to tuple
return t

print(lenwords("Come let us have some fun"))

OR

def removeDuplicate(L):
for i in L:
while(L.count(i)>1):
L.remove(i)

L=[12,34,12,34,34,67,94,85,36,24,33,34]
removeDuplicate(L)
print(L)

+½ Mark for iteration


+½ Mark for using count()
+½ Mark for using while
+½ Mark for using remove()
Part Marking/Full Marks to be given for any other correct logic.
25. import random
a= {0:” Orange”,1:” Apple”,2:” Grapes”,3:” Guava”4:” Pineapple”}
b= random.randint(1,4) (2)

for i in range(1,b,2):
print(a[i],end='#')

b can take the values of 1,2,3 and 4


i can take the value of
(1,1,2) - No output
(1,2,2) - Only for i=1 - Apple#
(1,3,2) - Only for i=1 - Apple#
(1,4,2) - Only for i=1,3 - Apple#Grapes#
(Any 2 correct output for 2 marks)
26. def prime():

n=int(input("Enter number to check :: ")) # 1.bracket missing


for i in range (2, n//2):
if n%i==0: # 2. = in place of ==
print("Number is not prime \n")
break #3. Wrong indent (2)

else:
print("Number is prime \n”) # 4. quote mismatch

(1/2 mark for each error underline)


27. A. COUNT(*) returns the count of all rows in the table,
Whereas COUNT () is used with Column_Name passed as argument and
counts the number of non-NULL values in a column that is given as
argument.
(1 mark for definition
1 mark for explaining with example)
(2)
B. Alter table Employee drop primary key
(1 mark for dropping primary key)

Alter table Employee add primary key(id)


(1 mark for adding primary key)

28.
A. Star Topology - 1 mark for correct identification
Advantage : Devices are easier to attach fault can be easily
detected
(1/2 for any one or any other correct answer)
Disadvantage: failure to central node or server causes a big (2)
loss that requires a lot of cable.
(1/2 for any one or any other correct answer)

OR
B. Sender's End: SMTP is a Simple mail transfer protocol that is
responsible for sending emails.

Receiver's End: POP when the receiver receives the email it does not
save in the server we can access it locally and even without the need for
an internet connection.

(1 mark for SMTP, 1 mark for POP)

Q No. SECTION C (3 X 3 = 9) Marks


29. (A)
def COUNTLINES() :
file = open ('TESTFILE.TXT', 'r')
lines = file.readlines()
count=0
for w in lines :
if (w[0]).lower() not in 'aeoiu'
count = count + 1
print ("The number of lines not starting with any vowel: ", count)
file.close()
COUNTLINES()
(½ mark for correctly opening and closing the file
½ for readlines()
½ mark for correct loop
½ mark for correct if statement (3)
½ mark for correctly incrementing count
½ mark for displaying the correct output)
OR
(B)
def vowel() :
file = open ('Words.TXT', 'r')
word = file.read().split()
for w in word:
w=w.lower()
if ('a' in w or 'e' in w or 'i' in w or 'o' in w or 'u' in w)
print(w)

file.close()

vowel()

(½ mark for correctly opening and closing the file


1 for .read(). + .split()
½ mark for correct loop
½ mark for correct if statement
½ mark for displaying the correct output)
30. (A)
employee_data={'E001':15000,'E002':27000,'E003':30000,'E004':15000,'E005'
:19000}
stk_emp=[]

def push_emp(employee_data):
for k,v in employee_data.items():
if v<25000:
stk_emp.append(k)

print(stk_emp)

def pop_emp():
while(stk_emp):
print(stk_emp.pop())
else:
print("Stack is empty")

push_emp(employee_data)
pop_emp()

(1.5 Mark for correctly writing Push() and 1.5 mark for Correctly Writing
pop())
(1 Mark for traversing dictionary correctly and appending value and ½ mark
(3)
for correctly calling function and syntax)

OR
(B)
studentList=[['Akansha',9,"Mathematics"],["Priti",96,"Science"],["Garima",99,
"Science"],["Ayushi",78,"English"]]
StudentInfo=[]
def Push_student(studentList):
for student in studentList:
if(student[2].lower()=="science"):
studentMarks=(student[0],student[1])
StudentInfo.append(studentMarks)
print(StudentInfo)

def Pop_student():
while(StudentInfo):
print(StudentInfo.pop())
else:
print("Empty Stack")

Push_student(studentList)
Pop_student()
(1/2 for writing correct function definitions)
(1/2 mark for correctly adding data to stack, ½ mark for correctly checking
condition)
(1/2 mark for correctly popping data on the stack and 1/2 mark for Empty Stack
condition)
(1/2 mark for function call statements)
31. A. gIDIA@ GroIiG

1 mark for correctly writing the lower case alphabets, 1 mark for correctly
writing uppercase and @
1 mark for writing the whole output correctly.

OR

B. Output:
105#6#
(1 mark for 105# and 1 mark for 6# and 1 mark for writing the whole output in a
single line)

Q No. SECTION D (4 X 4 = 16) Marks


32. (A)
(a) SELECT NAME FROM DOCTOR WHERE DEPT =‘MEDICINE’ AND EXPERIENCE > 10;
(b) Select min(allowance) from salary s, Doctor d where s.Id=d.Id and sex=”F” ;
(c) select min(basic+ allowance+ consultation) as minSalary, max(basic +allowance
+consultation) as maxSalary, sex from salary s, doctor d where s.Id=d.Id group by
sex;
(d) update salary set basic=basic+(10/100)*basic where Id in (114,130);

(4 x 1 mark for each correct query) (4)


OR
(B)
Dept Main_Sal
------------------------------
ENT 33700
Medicine 87000
Cardiology 42000

ID Name Dept Sex Experience


---------------------------------------------------------------------
101 Amit ENT Male 12
104 Nitin Medicine Male 8
107 Rakshit Cardiology Male 14
109 Rashmi ENT Female 11
Name Basic
------------------------------
Amit 12000
Rashmi 21700
Nitin 32000
Rakshit 42000
Sulekha 55000

maxSal
------------
56250
(4 x 1 mark for each correct output)

33.
A.
def CSVOpen():
import csv
f=open("books.csv",'a')
writerobj=csv.writer(f)
Title=input("Enter Title")
Author=input("Enter Author"))
Price=float(input("Enter Price"))
row=[Title,Author,Price]
writerobj.writerow(row)
(4)
f.close()

B.
def CSVRead():
import csv
f=open("books.csv",'r')
records=csv.reader(f)
next(records, None) #To skip the Header row
for i in records:
if i[0][:2]=="Ra":
print("Title",i[0])
print("Author",i[1])
print("Price",i[2])
f.close()

(½ mark for opening the file in right mode)


(½ mark for correctly creating the writer object)
(½ mark for correctly taking the inputs)
(½ mark for correctly using writeRow())
(½ mark for opening the file in right mode)
(½ mark for correctly creating the reader object)
(½ mark for iteration)
(½ mark for condition checking and printing)

34. a) Select carname from carmarket where carname like 'i%a';


b) Select company, count(*) from carmarket group by company;
c) Select company, max(DOM) from carmarket group by company;
d) Select company, avg(cost) from carmarket group by company having
avg(cost) < 30;

OR

e) Degree = 6, Cardinality = 6
(4x1 mark for each correct query) (4)
35. import mysql.connector as mydb
mycon = mydb.connect(host = “localhost”, user = “root”, password =
“p123”,database = “product”)
cursor = mycon.cursor ( )
sql = “SELECT * FROM MobileMaster WHERE M_Price > 8000”
cursor.execute (sql)
display = cursor. fetchall ( )
for i in display:
print(i)
(4)
(½ mark for correctly importing the connector object)
(½ mark for correctly creating the connection object)
(½ mark for correctly creating the cursor object)
(½ mark for correct creation of query)
(½ mark for correctly executing the query)
(½ mark for correctly using fetchall())
(½ mark for iteration)
(½ mark for printing)

Q No. SECTION E (2 X 5 = 10) Marks


36. (5)
A.
import pickle
def append_student():
f=open("student.dat","ab")
Roll=int(input("Enter Roll"))
Name=input("Enter Name")
Class=int(input("Enter Class"))
Percent=float(input("Enter Percentage"))
L=[Roll, Name, Class, Percent]
pickle.dump(L,f)
f.close()

B.
import pickle
def updBin(roll,updMarks):
f=open(“student.dat”,”rb”)
L=[]
try:
while True:
data=pickle.load(f)
if(data[0]==roll):
data[-1]=updMarks
L.append(data)
except:
pass
f.close()
f=open(“student.dat”,”wb”)
for i in L:
pickle.dump(i,f)
f.close()
C.

import pickle
def displayStud():
f=open(“student.dat”,”rb”)
try:
while True:
data=pickle.load(f)
if(data[-1]>90):
print("Roll", data[0])
print("Name", data[1])
print("Class", data[2])
except:
pass
f.close()

A. (1/2 mark of import pickle and opening file in


correct mode)
(1/2 mark for input)
(1/2 mark for correctly using dump function)

B. (1 mark for checking the condition and updating the value)


(1/2 mark for using try except and while)
(1/2 mark for pickle.load and pickle.dump)

C. (1 mark for checking the condition and displaying data correctly after load)
(1/2 mark for using try except and while)

37. A. Movie editing block is the most appropriate to house the server as it has (5)
the maximum number of computers.
(1/2 mark for naming the server block and ½ mark for correct reason.)
B. Firewall
(1 mark for the correct answer)
C. Ethernet Cable Layout:
( ½ mark correct wired medium , ½ mark for any correct layout without
loop – either Star or Bus topology)
D. Switch/hub will be placed in all blocks to have connectivity within the
block.

Repeater is not required between the blocks as the distances are less than
100 mts.
(1/2 mark for each of the correct answer)
E. Protocol: VoIP
(1 mark for the correct answer)

OR

F. LAN
(1 mark for the correct answer)

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