0% found this document useful (0 votes)
51 views14 pages

CS MS 3

Uploaded by

s67369354
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)
51 views14 pages

CS MS 3

Uploaded by

s67369354
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/ 14

केन्द्रीय विद्यालय संगठन, कोलकाता संभाग

KENDRIYA VIDYALAYA SANGATHAN, KOLKATA REGION


अभ्यास सेट-II / PRACTICE SET-II : 2024-25
कक्षा / CLASS : XII अविकतम अंक / MAX. MARKS : 70
विषय / SUB : COMPUTER SCIENCE (083) समय / TIME : 03 घंटे / Hours
*** MARKING SCHEME ***
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.

Section A

1· State True or False: An exception is caught in the try block and handles in except block.
Ans. True 1
2· Identify the output of the following code snippet:
WORDS = "DYD YYDYD DYD"
WORDS = WORDS.replace('YD', 'DY')
print(WORDS)
(a) DYD YYDYD DYD (b) DDY YYDYD DYD
(C) DDY YYDYD DDY (d) DDY YDYDY DDY
Ans. (d) DDY YDYDY DDY 1
3· Which of the following expressions evaluates to True?
(a) not(True) and not(True or False) (b) not(not False or not(True and False))
(c) not(not True and not(False or True)) (d) not(not True or not(False and True))
Ans. (c) not(not True and not(False or True)) 1
4· What is the output of the expression?
MyTarget = 'Computer Science is 100%'
print(MyTarget.partition("e"))
(a) ('Comput', 'e', 'r Science is 100%') (b) ('Comput', 'r Sci', 'nc', ' is 100%')
(c) ['Comput', 'e', 'r Science is 100%'] (d) ['Comput', 'r Sci', 'nc', ' is 100%']
Ans. (a) ('Comput', 'e', 'r Science is 100%') 1
5· What will be the output of the following code snippet?
SUB = "Computer Science"
print(SUB[-2::-4])
Ans. ccem 1
6· What will be the output of the following code?

Page 1 of 14
LIST = [11, 22, 33]
TUPLE = (11, 22, 33)
VALUE = tuple(LIST)
print(VALUE is TUPLE)
(a) True (b) False (c) (11, 22, 33) (d) ERROR
Ans. (b) False 1
7· If My_Sub is a dictionary as defined below, then which of the following statements will raise an
exception?
My_Sub = {'083': 'CS', '041': 'MATHS', '322': 'SANSKRIT CORE'}
(a) My_Sub.pop('041') (b) My_Sub.popitem('041')
(c) My_Sub.get('041') (d) My_Sub.items()
Ans. (b) My_Sub.popitem('041') 1
8· What does the STRING.find(str, start, end) method do in Python?
(a) Returns the first occurrence of index of substring str occurring in the given string and if the
substring is not present in the given string, then the function returns -1.
(b) Returns number of times substring str occurs in the given string.
(c) Returns the first occurrence of index of substring str occurring in the given string but
raises an exception if the substring is not present in the given string.
(d) Returns all the occurrence of index of substring str occurring in the given string.
Ans. (a) Returns the first occurrence of index of substring str occurring in the given string and if the
substring is not present in the given string, then the function returns -1. 1
9· If a table which has one Candidate key and one Primary Key. How many Alternate keys will this
table have?
(a) 0 (b) 1 (c) 2 (d) 3
Ans. (a) 0 1
10· Write the missing statement to complete the following code to get the desired output:
Consider the notepad : BOOK.txt and the Output:
Computer Science Science
Physics
Chemistry
Code: file = open("BOOK.txt", "r")
data = file.readline()
________________ # Move the file pointer to the desired position of the file
print(file.read(7))
file.close()
Ans. file.seek(9) or, file.seek(9, 0) 1
11· State whether the following statement is True or False:
Raising an exception involves interrupting the normal flow of the program execution and
jumping to the exception handler.
Ans. True 1
12· What will be the output of the following code?
G = 10
L = 20
def NOTES():
global G
G=G+L
print(G, end = '&')
L=L+G
NOTES()
Page 2 of 14
print(L, end = '=')
(a) 40&30= (b) 30&30= (c) 30&50= (d) ERROR
Ans. (a) 40&30= 1
13· Which SQL command can change the cardinality of an existing relation?
Ans. INSERT or, INSERT INTO, Delete 1
14· What will be the output of the query?
SELECT * FROM TABLEA, TABLEB;
(a) Cartesian Product on two tables – TABLEA and TABLEB
(b) Equi-join of two tables – TABLEA and TABLEB
(c) Natural join of two tables – TABLEA and TABLEB
(d) ERROR
Ans. (a) Cartesian Product on two tables – TABLEA and TABLEB 1
15· Which two constraints when applied together will produce a Primary Key constraint?
Ans. UNIQUE and NOT NULL 1
16· Consider the Table SCHOOL_FEES:
+--------------+ What will be the output of the following query:
| FEE_PAID | SELECT AVG(FEE_PAID) FROM SCHOOL_FEES;
+--------------+
| 2800 ---| (a) 2175
| 3600 ---| (b) 2900
| NULL ---| (c) 3200
| 2300 ---| (d) 2300
+-------------+
Ans. (b) 2900 1
17· Which protocol is used for establishing secure web communication?
(a) HTTP (b) FTP (c) PPP (d) HTTPS
Ans. (d) HTTPS 1
18· Which network device is used for conversion between analog signals and digital bits?
(a) Repeater (b) Switch (c) Gateway (d) Modem
Ans. (d) Modem 1
19· Which switching technique the following statements refers to?
Before a communication starts, a dedicated path is identified between the sender and the
receiver. This path is a connected sequence of links between network nodes. All packets follow
the same path established during the connection.
Ans. Circuit Switching 1
Q.20 and Q.21 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) : Python sets are mutable data type


Reason(R) : The first character has the index 0 and the last character has the index n-1
where n is the length of the set.
Ans. (c) A is True but R is False 1
21· Assertion(A) : ALTER TABLE statement in SQL can change the degree of an existing relation.
Reason(R) : ALTER TABLE statement is used to make changes in the structure of a table like
adding, removing or changing data type of column(s).
Ans. (a) Both A and R are true and R is the correct explanation for A 1
Page 3 of 14
Section B

22· How is == (relational operator) different from is (identity operator) in Python?


Identify the valid identifiers from the following:
(a) _TRUE (b) 1True (c) True% (d) True
Ans. Correct difference between == and is 1
(a) _TRUE 1
23· Write name of the modules that are to be import in Python to execute following functions:
(a) floor() (b) writer() (c) mode() (d) load()
Ans. (a) math [½ mark] (b) csv [½ mark] (c) statistics [½ mark] (d) pickle [½ mark] 2
24· The following code is typed in Interactive Mode of Python. Complete the missing outputs:
>>> L1 = ["CS", "PHY", "CHEM"]
>>> L2 = [len(L1[2]), len(L1[1]), len(L1[0])]
>>> L3 = L1.extend(L2)
>>> print(L3) # (a)
__________________________________
>>> print(L1) # (b)
__________________________________
>>> print(sorted(L2)) # (c)
__________________________________
>>> print(2 * L2) # (d)
__________________________________
Ans. (a) None [½ mark]
(b) ['CS', 'PHY', 'CHEM', 4, 3, 2] [½ mark]
(c) [2, 3, 4] [½ mark]
(d) [4, 3, 2, 4, 3, 2] [½ mark] 2
Or,

24· If L1 = ["CS", "PHY", "CHEM"] and L2 = [4, 3, 2], then


(a) Write a Python statement to get the following output:
['CHEM', 'PHY', 'CS']
(b) Write a Python statement to get the following output:
[4, 3, 2, 'CS', 'PHY', 'CHEM']
Ans. (a) L1.reverse() [1 mark]
(b) L2 + L1 [1 mark] 2
25· Identify the correct output(s) of the following code. Also write the minimum and the maximum
possible values of the variable planets.
import random
ecliptic = "Zodiac"
planets = random.randint(1,6)
for luck in range(0, planets, 2):
print(ecliptic[luck], end = '100%')
(a) Z100% (b) Z100%i100% (c) Z100%d100%a100% (d) Z100%a100%
Ans. (a) Z100% [½ mark] (c) Z100%d100%a100% [½ mark]
Min. and Max. value of planets = (1, 6) [½ + ½ mark]
If Additional Options Marked with correct options (a, c) then deduct ½ mark. 2
26· The code provided below is intended to find the factorial of an integer. However, there are
syntax and logical errors in the code. Rewrite it after removing all errors. Underline all the
Page 4 of 14
corrections made.
def factorial_function(n):
if n < 0
return "Factorial is not defined for negative numbers."
result = 1
for i in range(2, n + 1):
result =* i
return result
number = int(input("Enter a number: ")
print("Factorial of", number "is:", factorial_function(number))
Ans. def factorial_function(n):
if n < 0: [½ mark]
return "Factorial is not defined for negative numbers."
result = 1
for i in range(2, n + 1):
result *= i [½ mark]
return result
number = int(input("Enter a number: ")) [½ mark]
print("Factorial of", number, "is:", factorial_function(number)) [½ mark] 2

27· (i) (a) Write SQL command to display the maximum value in the SALARY column (attribute)
of the MANAGEMENT table.
Or,
(b) Write an SQL command to remove the Primary Key constraint from a table, named
MANAGEMENT. EMP_ID is the primary key of the table.

(ii) (a) Write SQL command to determine the count of rows in the MANAGEMENT table.
Or,
(b) Write an SQL command to make the column EMP_ID the Primary Key of an already
existing table, named MANAGEMENT.
Ans. (i) (a) SELECT MAX(SALARY) FROM MANAGEMENT; [1 mark]
Or,
(i) (b) ALTER TABLE MANAGEMENT DROP PRIMARY KEY; [1 mark]
(ii) (a) SELECT COUNT(*) FROM MANAGEMENT; [1 mark]
Or,
(ii) (b) ALTER TABLE MANAGEMENT ADD PRIMARY KEY (EMP_ID); [1 mark]
For Partially Correct Answers award ½ mark. 2

28· (a) Illustrate with an example to show the difference between Star and Bus topologies.
Or,
(b) What is the use of VoIP ? Give any one example VoIP applications.
Ans. (a) Star topology is more reliable, easier to manage, and scalable, but can be more expensive
due to the need for a central hub or switch.
Bus topology is simpler and more cost-effective but prone to data collisions and harder to scale
as the network grows.
[Any Other Correct Difference Award 1 mark]
Example Any One – [1 mark]
Or, 2
Ans. (b) VoIP (Voice over Internet Protocol) is a technology that allows you to make voice calls and 2
Page 5 of 14
multimedia communication over the Internet rather than through traditional telephone lines.
[Any Other Correct Use, Award 1 mark]
Example: Skype, Zoom, Google Meet, Microsoft Teams, etc.
[Any One Example, Award 1 mark]

Section C

29· (a) Write a Python function RECORD_C( ) that displays all the words with exactly 5 characters
and starts with C or, c from a text file "COLLECTION.txt".
Ans. def RECORD_C(): [ ½ mark]
f = open("COLLECTION.txt", "r") [ ½ mark]
data = f.readlines() [ ½ mark]
for sentence in data:
word = sentence.split() [ Correct for loop ½ mark]
for each in word:
if len(each) == 5 and (each.startswith('C') or each.startswith('c')):
print(each) [ Correct for loop and print statement 1 mark]
f.close()
RECORD_C() 3
Or,

29· (b) Write a Python function RECORD_E() that finds and displays all the words longer than 4
characters and ends with ‘e’ or, ‘E’ from a text file "Words.txt".
Ans. def RECORD_E(): [ ½ mark]
f = open("COLLECTION.txt", "r") [ ½ mark]
data = f.readlines() [ ½ mark]
for sentence in data:
word = sentence.split() [ Correct for loop ½ mark]
for each in word:
if len(each) > 4 and (each.endswith('E') or each.endswith('e')):
print(each) [ Correct for loop and print statement 1 mark]
f.close()
RECORD_E() 3

30· (a) (i) Write the definition of a user-defined function PUSH_CCA(PARTICIPANTS) which
accepts a list of students with details of each as [NAME, HOUSE, RANK] in a
parameter PARTICIPANTS and pushes all those students details whose RANK = 1
from the list PARTICIPANTS into a Stack named PRIZE.
(ii) Write function POP_ CCA() to pop the topmost student details from the stack and
returns it. If the stack is empty, the function should display "Empty".
(iii) Write function DISPLAY_CCA() to display all element of the stack without deleting
them. If the stack is empty, the function should display 'None'.
For example:
If PARTICIPANTS = [['ARYAN','RED',2],['SWATI','BLUE',1],['ADRIJA','GREEN',3],
['DAVIDA','RED',1],['SHAURYA','YELLOW',1]]
Then the stack PRIZE should store:
['SWATI', 'BLUE', 1]
['DAVIDA', 'RED', 1]
['SHAURYA', 'YELLOW', 1]
Page 6 of 14
If the top element pop out is ['SHAURYA', 'YELLOW', 1]
Then the stack will display as:
['DAVIDA', 'RED', 1]
['SWATI', 'BLUE', 1]
Ans. (a) PRIZE = list()

def PUSH_CCA(PARTICIPANTS): [Correct function definition award 1 mark]


for EACH in PARTICIPANTS:
if EACH[2] == 1:
PRIZE.append(EACH)
print(EACH)

def POP_CCA(): [Correct function definition award 1 mark]


if len(PRIZE) == 0:
print("Empty")
else:
element = PRIZE.pop()
print(element)
return element

def DISPLAY_CCA(): [Correct function definition award 1 mark]


t = len(PRIZE)
if t == 0:
print("None")
else:
for i in range(-1,-t-1,-1):
print(PRIZE[i])

PARTICIPANTS = [['ARYAN','RED',2], ['SWATI','BLUE',1],


['ADRIJA','GREEN',3],['DAVIDA','RED',1],
['SHAURYA','YELLOW',1]]
PUSH_CCA(PARTICIPANTS)
POP_CCA()
DISPLAY_CCA()
[Partially Correct Function Definition, award ½ mark] 3
Or,

(b) You have a stack named ELIGIBLE that contains records of students. Each student record is
represented as a list containing STUDENT_NAME, MOBILE_NUM, and
ATTENDANCE_PERCENT. Write the following user-defined functions in Python to perform
the specified operations on the stack ELIGIBLE:
(i) PUSH_EXAM(): This function asks for the student data one by one till records exist
and if the ATTEDANCE_PERCENT > 75 then the student record pushes to the stack
ELIGIBLE.
(ii) POP_EXAM(): This function pops the topmost student record from the stack. If the
stack is empty, the function should display "Underflow".
(iii) TOP_EXAM(): This function displays the topmost element of the stack without
deleting it. If the stack is empty, the function should display 'None'.
Ans. ELIGIBLE = list() 3

Page 7 of 14
def PUSH_EXAM(): [Correct function definition award 1 mark]
RECORD = list()
while True:
STUDENT_NAME = input("Enter Name: ")
MOBILE_NUM = input("Mobile Number: ")
ATTENDANCE_PERCENT = float(input("Attendance Percentage: "))
RECORD = [STUDENT_NAME, MOBILE_NUM, ATTENDANCE_PERCENT]
if RECORD[2] > 75:
ELIGIBLE.append(RECORD)
print(RECORD)
op = input("Want to ENTER MORE RECORDS (Y/N): ")
if op in "nN":
break

def POP_EXAM(): [Correct function definition award 1 mark]


if len(ELIGIBLE) == 0:
print("Underflow")
else:
element = ELIGIBLE.pop()
print(element)

def TOP_EXAM(): [Correct function definition award 1 mark]


t = len(ELIGIBLE)
if t == 0:
print("None")
else:
print(ELIGIBLE[-1])

PUSH_EXAM()
POP_EXAM()
TOP_EXAM()
[Partially Correct Function Definition, award ½ mark]

31· Predict the output of the following code:


mS = ('CS','PHYSICS','CHEM','ENG','MATHS')
VALUE = (len(mS), len(mS[-4]), len(mS[0]))
for OPTION in VALUE:
for NEXT in range(1, OPTION%len(VALUE)):
print(NEXT, end = '#')
print(OPTION)
Ans. 1#5 [1 mark]
7 [1 mark]
1#2 [1 mark] 3
Or,
31· Predict the output of the following code:
MOBILE = {"Samsung":"Galaxy S24 Ultra","Apple":"iPhone 16 Pro"}
BRAND = str()
for DATA in MOBILE:
Page 8 of 14
BRAND = BRAND + MOBILE[DATA]
SHOW = BRAND[::-1]
print(SHOW)
print(len(BRAND))
Ans. artlU 42S yxalaG [1 mark]
orP 61 enohPiartlU 42S yxalaG [1 mark]
29 [1 mark] 3

Section D

32· Consider the table FINANCE as given below

(a) Write the following queries:


(i) To display the total FEE for each STREAM, excluding STREAM where total FEE is less
than 3000.
Ans. SELECT STREAM, SUM(FEE) FROM FINANCE [½ mark]
GROUP BY STREAM HAVING SUM(FEE) >= 3000; [½ mark] 1
(ii) To display the FINANCE table sorted by FEE in descending order.
SELECT * FROM FINANCE [½ mark]
ORDER BY FEE DESC; [½ mark] 1
(iii) To display the distinct student names from the FINANCE table.
SELECT DISTINCT S_NAME [½ mark]
FROM FINANCE; [½ mark] 1
(iv) Display the sum of FEE of all the STUDENTS for which the NUM_OF_MONTHS is null.
SELECT SUM(FEE) FROM FINANCE [½ mark]
WHERE NUM_OF_MONTHS IS NULL; [½ mark] 1
Or,

(b) Write the output:


Ans. (i) SELECT S_NAME, SUM(FEE) AS TOTAL_FEE FROM FINANCE GROUP BY S_NAME;

1
(ii) SELECT * FROM FINANCE WHERE S_NAME LIKE “%N%E%” ;

1
(iii) SELECT S_UID, S_NAME, STREAM, FEE FROM FINANCE WHERE FEE BETWEEN 3000
AND 4000;

Page 9 of 14
1
(iv) SELECT AVG(FEE) FROM FINANCE;
AVG(FEE)
2850 1
33· A csv file "ACHIEVERS.csv" contains the Students data. Each record of the file contains the
following data:
● Name of the Student
● Class
● Admission Number
● Result in percentage
For example, a sample record of the file may be:
[‘Aseema Sahu’, 12, 4865, 98]
Write the following Python functions to perform the specified operations on this file:
(i) DISPLAY() - Read all the data from the file in the form of a list and display all those records
for which the result percentage is more than 90.
(ii) COUNT_RECORDS() - Count the number of records in the file.
Ans. import csv [½ mark]

def DISPLAY(): [Correct Function Definition Award 1½ mark]


f = open("ACHIEVERS.csv", "r")
records = csv.reader(f)
next(records, None)
for each in records:
if each[3] > "90":
print(each)
f.close()

def COUNT_RECORDS(): [Correct Function Definition Award 1½ mark]


f = open("ACHIEVERS.csv")
records = csv.reader(f)
next(records, None)
counter = 0
for each in records:
counter += 1
print("Num of Records =", counter)
f.close()

DISPLAY() [Correct function call (both) award ½ mark]


COUNT_RECORDS()
[Partially Correct Function Definition, award ½ mark] 4
34· (a) Write an SQL statement to create a table named STUDENTS, with the following
specifications:

Page 10 of 14
Ans. CREATE TABLE STUDENTS (
StudentID NUMERIC PRIMARY KEY,
FirstName VARCHAR(20),
LastName VARCHAR(10),
DateOfBirth DATE,
Percentage FLOAT(10,2) );
[Fully correct award 2 marks, Partially correct award 1 mark] 2
(b) Write SQL Query to insert the following data in the Students Table:
1, Supriya, Singh, 2010-08-18, 75.5
Ans. INSERT INTO STUDENTS (StudentID, FirstName, LastName, DateOfBirth, Percentage)
[½ mark]
VALUES (1, 'Supriya', 'Singh', '2010-08-18', 75.5); [½ mark] 1
(c) Write an SQL Command to delete the table STUDENTS.
Ans. DROP TABLE STUDENTS;
[Fully correct award 1 mark, Partially correct award ½ mark] 1
35· A table, named TC_DETAILS, in SCHOOL database, has the following structure:
Field Type
Adm_Num Integer(5)
Student_Name Varchar(25)
FEE_PAID Float
TC_NUM Integer(5)
Write the following Python function to perform the specified operation:
NEWTC() : To input details of a student taking TC and store it in the table TC_DETAILS. The
function should then retrieve and display all records from the TC_DETAILS table where the
TC_NUM is greater than 10000.
Assume the following for Python-Database connectivity:
Host: localhost, User: root, Password: Tc2000
Ans. import mysql.connector as mycon
mydb = mycon.connect(host="localhost",user="root",passwd="Tc2000",database="SCHOOL")
[Correct import statement and connection - 1 mark]
mycur = mydb.cursor() [½ mark]

def NEWTC():
Adm_Num = int(input("Enter Admission Number: "))
Student_Name = input("Enter Student Name: ")
FEE_PAID = float(input("Enter Fee Paid: ")) [ All correct Inputs - ½ mark]
TC_NUM = int(input("Enter TC Number: "))
query = "INSERT INTO TC_DETAILS VALUES ({},'{}',{},{})"
query = query.format(Adm_Num, Student_Name, FEE_PAID, TC_NUM)
[Correct query - ½mark]
mycur.execute(query) [Correct Commit and execute - ½ mark]
mydb.commit()
mycur.execute("SELECT * FROM TC_DETAILS WHERE TC_NUM > 10000") [½ mark] 4

Page 11 of 14
for rec in mycur: [Correct for loop – ½ mark]
print(rec)

NEWTC()
Section E

36· AAM Enterprise has been established as a premier autonomous testing organisation to conduct online/
offline examination in different schools. The organisation needs to manage the records of various
candidates. For this, the organisation wants the following information of each candidate to be stored:
 Student_ID – integer (Admission Number)
 Student_Name – string
 Exam_Opt – string (Online/ Offline)
 Class – integer (12, 11, 10, 9 and so on)
You, as a programmer of the organisation, have been assigned to do this job. Write the following
functions to execute the program:
(i) EXAM_INPUT() - A function to input the data of the students those are interested to appear for the
exam and append it in a binary file – “STUDENT_EXAM.dat”. Exam_Opt will be Offline for all.
(ii) EXAM_UPDATE() - A function to update the data of students (“STUDENT_EXAM.dat”) who are in
Class 12 and change their Exam_Opt to "Online".
(iii) EXAM_SHOW() - A function to read the data from the binary file and display the data of all those
candidates who are in Class 11 and 12.
Ans. import pickle [½ mark]

def EXAM_INPUT(): [Correct Function Definition Award 1½ mark, Partially Correct – 1 mark]
f = open("STUDENT_EXAM.dat", "wb")
RECORD = list()
while True:
Student_ID = int(input("Enter Admission Number: "))
Student_Name = input("Enter Student Name: ")
Exam_Opt = "Offline"
Class = int(input("Enter Class: "))
DATA = [Student_ID, Student_Name, Exam_Opt, Class]
RECORD.append(DATA)
op = input("Want to add MORE STUDENTS (Y/N): ")
if op in "nN":
break
pickle.dump(RECORD, f)
print("File Created and Data Updated Successfully")
f.close()

def EXAM_UPDATE(): [Correct Function Definition Award 1½ mark, Partially Correct – 1 mark]
f = open("STUDENT_EXAM.dat", "rb")
RECORD = pickle.load(f)
f.close()
NEW_RECORD = list()
with open("STUDENT_EXAM.dat", "wb") as f:
for EACH in RECORD:
if EACH[3] == 12:
EACH[2] = "Online"
NEW_RECORD.append(EACH) 5

Page 12 of 14
pickle.dump(NEW_RECORD, f)
print("RECORD UPDATED SUCCESSFULLY")

def EXAM_SHOW(): [Correct Function Definition Award 1½ mark, Partially Correct – 1 mark]
f = open("STUDENT_EXAM.dat", "rb")
RECORD = pickle.load(f)
for EACH in RECORD:
if EACH[3] == 11 or EACH[3] == 12:
print(EACH)
f.close()

EXAM_INPUT()
EXAM_UPDATE()
EXAM_SHOW()
37· Ayansh Pvt. Ltd., a multinational technology company, is looking to establish its Indian Head
Office in Bengaluru, and a regional office branch in Lucknow. The Bengaluru head office will be
organized into four departments: HR, FINANCE, TECHNICAL, and SUPPORT.
As a network engineer, you have to propose solutions for various queries listed from (a) to (e).

The shortest distances between the departments/offices are as follows:

The number of computers in each department/office is as follows:

(a) Suggest the most suitable department in the Bengaluru Office Setup, to install the server.
Also, give a reason to justify your suggested location.
Ans. The server should be installed in the HR department as it has the most number of
computers. [½ mark for Suggestion, ½ mark for Correct Reason] 1
(b) Draw a suitable cable layout of wired network connectivity between the departments in
the Bengaluru Office.
Page 13 of 14
Ans.

1
(c) Which networking device would you suggest the company to purchase to interconnect all
the computers within a department in Bengaluru Office?
Ans. Switch/Hub 1
(d) The company is considering establishing a network connection between its Bengaluru Head
Office and Lucknow regional office. Which type of network—LAN, MAN, or WAN—will be
created? Justify your answer.
Ans. WAN (Wide Area Network) will be created as the offices are located in different cities.
[½ mark for WAN, ½ mark for Correct Reason] 1
(e) Is there a requirement of a repeater in the given cable layout? Why/ Why not?
Ans. There is no requirement of the Repeat as the distance between each block is less than
100m.
[½ mark for No, ½ mark for Correct Reason] 1

Page 14 of 14

You might also like