23-CS-MS-4
23-CS-MS-4
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.
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)
for i in range(1,b,2):
print(a[i],end='#')
else:
print("Number is prime \n”) # 4. quote mismatch
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.
file.close()
vowel()
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)
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()
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)
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()
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)