[go: up one dir, main page]

0% found this document useful (0 votes)
9 views25 pages

Ms Question Paper-2

The document outlines the marking scheme for the 1st Preboard exam for Computer Science for the academic year 2024-25, detailing the structure of the question paper which consists of 37 compulsory questions divided into 5 sections with varying marks. Each section tests different skills, including programming in Python and SQL knowledge. It also includes specific instructions for answering questions, particularly regarding multiple-choice questions and programming syntax.

Uploaded by

gitasaram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views25 pages

Ms Question Paper-2

The document outlines the marking scheme for the 1st Preboard exam for Computer Science for the academic year 2024-25, detailing the structure of the question paper which consists of 37 compulsory questions divided into 5 sections with varying marks. Each section tests different skills, including programming in Python and SQL knowledge. It also includes specific instructions for answering questions, particularly regarding multiple-choice questions and programming syntax.

Uploaded by

gitasaram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

MARKING SCHEME OF 1st PREBOARD 2024-25

( COMPUTER SCIENCE)
Time allowed: 3 Hours 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 ( No marks
should be provided if student does not write the correct choice )

Q No. Section-A (21 x 1 = 21 Marks) Marks

1. State True or False:


(1)
The Python statement print(‘Alpha’+1) is example of TypeError Error

Ans : True
2. What id the output of following code snippet?

country = "GlobalNetwork" (1)


result =
"-".join(country.split("o")).upper()
print(result)
(A) GL-BALNETW-RK
(B) GL-BA-LNET-W-RK
(C) GL-BA-LNET-W-RK
(D) GL-BA-LNETWORK

Ans : A ) GL-BALNETW-RK
3. Identify the output of the following code snippet:

text =
"The_quick_brown_fox"
(1)
index = text.find("quick")
result = text[:index].replace("_", "") +
text[index:].upper() print(result)

(A) Thequick_brown_fox
(B) TheQUICK_BROWN_FOX
Page: 1/25
(C) TheQUICKBROWNFOX
(D) TheQUICKBROWN_FOX

Ans : (B) TheQUICK_BROWN_FOX

What will be the output of the following Python


4.
expression? x = 5
y = 10
(1)
result = (x ** 2 + y) // x * y - x
print(result)

(A) 0
(B) -5
(C) 65
(D) 265

Ans : ( C ) 65
What will be the output of the following code snippet?
5.
(1)
text = "Python Programming"
print(text[1 : :3])

(A) Ph oai
(B) yoPgmn
(C) yhnPormig
(D) Pto rgamn
Ans : (B)
6. What will be the output of the following code?
tuple1 = (1, 2, 3)
tuple2 = tuple1 + (4,)
tuple1 += (5,)
print(tuple1, tuple2) (1)

(A) (1, 2, 3) (1, 2, 3, 4)


(B) (1, 2, 3, 5) (1, 2, 3)
(C) (1, 2, 3, 5) (1, 2, 3, 4)
(D) Error

Ans : C )
7. Dictionary my_dict as defined below, identify type of error raised by statement
my_dict['grape']?
my_dict = {'apple': 10, 'banana': 20, 'orange': 30}
ValueError (1)
(B) TypeError
(C) KeyError
(D) ValueError
Ans : (C) KeyError

Page: 2/25
What does the list.pop(x) method do in Python?
8.

A. Removes the first element from the list. (1)


B. Removes the element at index x from the list and returns it.
C. Adds a new element at index x in the list.
D. Replaces the element at index x with None.

Ans : B. Removes the element at index x from the list and returns it.

In a relational database table with one primary key and three


9.
unique constraints defined on different columns (not primary), how
many candidate keys can be derived from this configuration?
(1)
(A) 1
(B) 3
(C) 4
(D) 2

Ans : C) 4
10. Fill in the blanks to complete the following code snippet
choosing the correct option:

with open("sample.txt", "w+") as file:


(1)
file.write("Hello, World!") # Write a string to the file
position_after_write = file. # Get the position after
writing file.seek(0) # Move the pointer to the beginning
content = file.read(5) # Read the first 5 characters
print(content)

(A) tell
(B) seek
(C) read
(D) write

Ans : (A) tell

11. State whether the following statement is True or False:


In Python, if an exception is raised inside a try block and not
handled, the program will terminate without executing any (1)
remaining code in the finally block.

Ans : False

Page: 3/25
12. What will be the output of the following
code? x = 4
def reset():
global
xx=
2
print(x, (1)
end='&') def
update():
x += 3
print(x, end='@')

update(
)x=6
reset()
print(x, end='$')

(A) 7@2&6$
(B) 7@6&6$
(C) 7@2&2$
(D) Error
Ans : (D) Error : Unbound local variable x in function
update()
Which SQL command can modify the structure of an existing table,
13. (1)
such as adding or removing columns?

(A) ALTER TABLE


(B) UPDATE TABLE
(C) MODIFY TABLE
(D)CHANGE TABLE

Ans. (A) ALTER TABLE


14. What will be the output of the query?
SELECT * FROM orders WHERE order_date LIKE '2024-
10-%';
(A) Details of all orders placed in October 2024 (1)
(B) Details of all orders placed on October 10th, 2024
(C) Details of all orders placed in the year 2024
(D) Details of all orders placed on any day in 2024

Ans : (A) Details of all orders placed in October 2024


Which of the following statements about the CHAR and
15.
VARCHAR datatypes in SQL is false?
(A) CHAR is a fixed-length datatype, and it pads extra spaces to
match the specified length. (1)
(B) VARCHAR is a variable-length datatype and does not pad extra
spaces.
(C) The maximum length of a VARCHAR column is always less
Page: 4/25
than that of a CHAR column.
(D) CHAR is generally used for storing data of a known, fixed length.
Ans : ( C )

16. Which of the following aggregate functions can be employed to


determine the number of unique entries in a specific column,
effectively ignoring duplicates?
(1)
(A) SUM()
(B) COUNT()
(C) AVG()
(D) COUNT(DISTINCT column_name)
Ans : (D) COUNT(DISTINCT column_name)

17. Which protocol is used to send e-mail over internet?


(A) FTP
(B) TCP
(C) SMTP
(D) SNMP (1)
Ans. (C) SMTP
18. Which device is primarily used to amplify and regenerate signals
in a network, allowing data to travel longer distances?
(A) Switch
(B) Router (1)
(C) Repeater
(D) Bridge
Ans : ( C) Repeater
19. Which communication technique establishes a dedicated
communication path between two devices for the entire duration (1)
of a transmission, ensuring a continuous and consistent
connection?

Ans : Circuit Switching


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
Assertion (A): Python functions can accept positional, keyword, and
20.
default parameters.

Reasoning (R): Default parameters allow function arguments to be (1)


assigned a default value if no argument is provided during the
function call.

Ans : (B) Both A and R are true and R is not the correct explanantion
for A
Page: 5/25
Assertion (A): A GROUP BY clause in SQL can be used without any
21.
aggregate functions.
Reasoning (R): The GROUP BY clause is used to group rows that (1)
have the
same values in specified columns and must always be
paired with aggregate functions.

Page: 6/25
Ans : ( C ) A is True , but R is False

Q No Section-B ( 7 x 2=14 Marks) Marks


Consider the following Python code snippet:
22.
a = [1, 2, 3]
b=a (2)
a.append(4)
c = (5, 6, 7)
d = c + (8,)
a. Explain the mutability of a and c in the context of this code.
b. What will be the values of b and d after the code is executed?

Ans : a) a is a mutable object (a list), meaning its contents can


be changed after it is created. This is demonstrated by the
append() method that adds an element to the list.
c is an immutable object (a tuple). Once created, its contents cannot
be changed. The operation c + (8,) does not modify c but creates a new
tuple.

b)The value of b will be [1, 2, 3, 4], as b references the same list as a,


which was modified by appending 4.
The value of d will be (5, 6, 7, 8), as the expression c + (8,) creates a
new tuple combining c and (8,).

( 1 marks + 1 Marks )

Give examples for each of the following types of operators in


23. Python: (2)
(I) Assignment Operators

(II) Identity Operators

Ans :

(I) Assignment Operators: ( 1 Marks for Any one of them)

1. Example 1: = (Simple Assignment) Usage: x = 5 (assigns


the value 5 to x)
2. Example 2: += (Add and Assign) : Usage: x += 3 (equivalent to
x
= x + 3)

(II) Identity Operators: ( 1 Marks for any one of them )

1. Example 1: is , Usage: x is y (checks if x and y refer to


the same object)
2. Example 2: is not : Usage: x is not y (checks if x and y
do not refer to the same object)

Page: 7/25
If L1 = [10, 20, 30, 40, 20, 10, ...] and L2 = [5, 15, 25, ...], then:
24.
(Answer using builtin functions only)

(I) A) Write a statement to count the occurrences of (2)


20 in L1. OR
B) Write a statement to find the minimum value in L1.

(II) A) Write a statement to extend L1 with all elements from L2.


OR
B) Write a statement to get a new list that contains the unique
elements from L1.

Ans : I ( A) : count_20 = L1.count(20)


(B) : min_value = min(L1)

II (A) : L1.extend(L2)
(B) : unique_elements = list(set(L1))

( 1 marks for each correct answer , no marks if did not used


any built in function )
25. Identify the correct output(s) of the following code. Also write the
minimum and the maximum possible values of the variable b.
import random
text = "Adventure"
b = random.randint(1, 5)
for i in range(0, b):
print(text[i], end='*') (2)

(A) A* (B) A*D*

(C) A*d*v* (D) A*d*v*e*n*t*u*


Ans :  Minimum possible value of b: 1 ( 1/2 + 1/2 marks)
 Maximum possible value of b: 5

Possible Outputs : (A) and ( C ) ( 1/2 + 1/2 marks )

Page: 8/25
26. The code provided below is intended to reverse the order of
elements in a given list. However, there are syntax and logical
errors in the code. Rewrite it after removing all errors. Underline
all the corrections made.

def
reverse_list(lst) (2)
if not lst:
return lst
reversed_lst =
lst[::-1] return
reversed_lst
print("Reversed list: " reverse_list[1,2,3,4] )

Ans : Corrections : ( 1/2 x 4 = 2)


iAdded a colon (:) after the function definition.
ii. Indented the if statement and the return statement for
proper structure.
iii. Put ( ) while calling the function reverse_list( )
iv. Added a comma (,) in the print statement for correct syntax.
27. (I)
A) What constraint should be applied to a table column to
ensure that all values in that column must be unique and not
NULL?
OR
B) What constraint should be applied to a table column to ensure (2)
that it can have multiple NULL values but cannot have any
duplicate non-NULL values?

Page: 9/25
(II)
A) Write an SQL command to drop the unique constraint
named unique_email from a column named email in a
table called Users.
OR
B) Write an SQL command to add a unique constraint to the
email column of an existing table named Users, ensuring that all
email addresses are unique.

Ans : (I)(A): Use the UNIQUE constraint along with the NOT NULL OR
PRIMARY KEY constraint.
OR
(B): Use the UNIQUE constraint alone, allowing for multiple NULL
values.
Example: column_name INT UNIQUE NULL

(II)(A):ALTER TABLE Users DROP CONSTRAINT unique_email;


OR
(B):ALTER TABLE Users ADD CONSTRAINT unique_email UNIQUE
(email);

( 1 mark each for correct part for each questions any correct example
as an answer is acceptable )

28. A) Explain one advantage and one disadvantage of mesh


topology in computer networks.
OR (2)
B) Expand the term DNS. What role does DNS play in the
functioning of the Internet?

Ans :
(A) : Advantage of Mesh Topology: High redundancy; if one connection
fails, data can still be transmitted through other nodes.
Disadvantage of Mesh Topology: Complexity and high cost; requires
more cabling and configuration compared to simpler topologies.
OR

(B) : · DNS stands for Domain Name System. It translates human-


readable domain names (like www.example.com) into IP addresses
that computers use to identify each other on the network.

( for part A 1/2 + 1/2 )


(for part B 1/2 for correct abbreviation and 1/2 for correct use)

Q No. Section-C ( 3 x 3 = 9 Marks) Marks

Page: 10/25
29. A) Write a Python function that extracts and displays all the words present in a
text file “Vocab.txt” that begins with a vowel..
OR (3)
B) Write a Python function that extracts and displays all the
words containing a hyphen ("-") from a text file
"HyphenatedWords.txt", which has a three letter word before
hypen and four letter word after hypen. For example : “for-
them” is such a word.
Ans : A)
def display_words_starting_with_vowel():
vowels = 'AEIOUaeiou'
with open('Vocab.txt', 'r') as file:
words = file.read().split()
# Loop through the words and check if the first letter is a vowel
for word in words:
if word[0] in vowels:
print(word)

B)
def display_specific_hyphenated_words():
with open('HyphenatedWords.txt', 'r') as file:
words = file.read().split()
# Loop through the words and check if they match the pattern
for word in words:
parts = word.split('-')
# Check if the word is hyphenated and matches the format "XXX-
XXXX"
if len(parts) == 2 and len(parts[0]) == 3 and len(parts[1]) == 4:
print(word)

1/2 mark for file opening + 1/2 mark for correct loop +1/2 mark for
correct use of split( ) + 1 mark for correct condition + 1/2 mark
for output

(A) You have a stack named MovieStack that contains records of


30. movies. Each movie record is represented as a list containing
movie_title, director_name, and release_year. Write the following
user-defined functions in Python to perform the specified
operations on the stack MovieStack:

(I) push_movie(MovieStack, new_movie): This function takes the


stack MovieStack and a new movie record new_movie as
arguments and pushes the new movie record onto the stack.

(II) pop_movie(MovieStack): This function pops the topmost


movie record from the stack and returns it. If the stack is
empty, the function should display "Stack is empty".
(3)
(III) peek_movie(MovieStack): This function displays the topmost
Page: 11/25
movie record from the stack without deleting it. If the stack is
empty, the function should display "None".

OR

(B) Write the definition of a user-defined function push_odd(M)


which accepts a list of integers in a parameter M and pushes all
those integers which are odd from the list M into a Stack named
OddNumbers.

Write the function pop_odd() to pop the topmost number from the
stack and return it. If the stack is empty, the function should
display "Stack is empty".

Write the function disp_odd() to display all elements of the stack


without deleting them. If the stack is empty, the function should
display "None".

For example:

If the integers input into the list NUMBERS are: [7, 12, 9, 4, 15]

Then the stack OddNumbers should store: [7, 9, 15]

Ans : (A )
def push_movie(movie_stack, new_movie): # 1 mark

movie_stack.append(new_movie)

def pop_movie(movie_stack):

if not movie_stack: # 1 mark

return "Stack is empty"

Page: 12/25
return movie_stack.pop()

def peek_movie(movie_stack):

if not movie_stack: #1

mark return "None"

return movie_stack[-1]
OR

(B) def push_odd(M, odd_numbers):

for number in M: # 1mark

if number % 2 != 0:

odd_numbers.append(number)

def pop_odd(odd_numbers):

if not odd_numbers: # 1mark

return "Stack is empty"

return odd_numbers.pop()

def disp_odd(odd_numbers):

if not odd_numbers: # 1mark

return "None"

return odd_numbers

Page: 13/25
31. Predict the output of the following code:
data = [3, 5, 7, 2]
result = ""
for num in data:
for i in range(num):
result += str(i) + "*"
result = result[:-1]
print(result)
OR

Predict the output of the following code: (3)


numbers = [10, 15, 20]
for num in numbers:
for j in range(num // 5):
print(j, "+", end="")
print()

Ans : 0*1*2*0*1*2*3*4*0*1*2*3*4*5*6*0*1
( 1 mark for predicting correct output sequence of
numbers + 1 mark for predicting correct placement
of * + 1 mark for removing last * )

OR
0 +1 +
0 +1 +2 +
0 +1 +2 +3 +
( 1 MARK For putting output in three lines + 1 mark for
predicting correct sequence of numbers in each line (
1/2 for incorrect partially correct) + 1 mark for
correct placement of + )
Q No. Section-D ( 4 x 4 = 16 Marks) Marks
32. Consider the table ORDERS as given below

O_Id C_Nam Product Quantit Price


100 e Laptop y1 1200
1 Jitendra Smartpho 2 0
1002 Mustafa ne 1 10000
1003 Dhwani Headphon 1 1500
1004 Alice e NULL 9000
1005 David Smartpho 7000
ne
Tablet

Note: The table contains many more records than shown here. (4)
A) Write the following queries:
(I) To display the total Quantity for each Product, excluding
Products with total Quantity less than 5.
Page: 14/25
(II) To display the ORDERS table sorted by total price in
descending order.
(III) To display the distinct customer names from the ORDERS
table.

Page: 15/25
(IV) To display the sum of the Price of all the orders for which the
quantity is NULL.
OR
B) Write the output:
(I) SELECT C_Name, SUM(Quantity) AS Total_Quantity FROM
ORDERS GROUP BY C_Name;
(II) SELECT * FROM ORDERS WHERE Product LIKE '%phone%';
(III) SELECT O_Id, C_Name, Product, Quantity, Price FROM
ORDERS WHERE Price BETWEEN 1500 AND 12000;
(IV) SELECT MAX(Price) FROM ORDERS;

Ans : (A) ( 1 MARK EACH)


(I) SELECT Product, SUM(Quantity) AS Total_Quantity
FROM ORDERS
GROUP BY Product
HAVING SUM(Quantity) >= 5;

(II) SELECT O_Id, C_Name, Product, Quantity,


Price FROM ORDERS
ORDER BY Price DESC;

(III) SELECT DISTINCT


C_Name FROM ORDERS;

(IV) SELECT SUM(Price) AS


Total_Price_Null_Quantity FROM ORDERS
WHERE Quantity IS NULL;

OR
(B) ( 1 MARK EACH )
(I)
C_Name Total_Quantity
Jitendra 1
Mustafa 2
Dhwani 1
Alice 1
David NULL

(II)
O_Id C_Name Product Quantity Price
1002 Mustafa Smartphone 2 10000
1004 Alice Smartphone 1 9000

Page: 16/25
(III)

O_Id C_Name Product Quantity Price


1001 Jitendra Laptop 1 12000
1002 Mustafa Smartphone 2 10000
1003 Dhwani Headphone 1 1500
1004 Alice Smartphone 1 9000
(IV)
MAX(Price)
12000

A CSV file "HealthData.csv" contains the data of a health survey.


33.
Each record of the file contains the following data:

 Name of a country
 Life Expectancy (average number of years a person is
expected to live)
 GDP per capita (Gross Domestic Product per person)
 Percentage of population with access to healthcare
(4)
For example, a sample record of the file may be: ['Wonderland',
82.5, 40000, 95].

Write the following Python functions to perform the specified


operations on this file:

(I) Read all the data from the file in the form of a list and display all
those records for which the life expectancy is greater than 75.

(II) Count the number of records in the file.

Ans : (I)
import csv
def read_health_data(filename):
records = []
with open(filename, mode='r') as file:
reader = csv.reader(file)
next(reader) # Skip the header row if present
for row in reader:
country = row[0]
life_expectancy = float(row[1])
gdp_per_capita = float(row[2])
access_to_healthcare = float(row[3])
if life_expectancy > 75 :
records.append([country, life_expectancy, gdp_per_capita,
access_to_healthcare])
return records

Page: 17/25
(II)
def count_records( ):
records = read_health_data(“HealthData.csv”)
return len(records)

Page: 18/25
Alex has been tasked with managing the Student Database for a
34.
High School. He needs to access some information from the
STUDENTS and SUBJECTS tables for a performance evaluation.
Help him extract the following information by writing the desired
SQL queries as mentioned below.
Table: STUDENTS
FNam
S_ID Mark LName Enrollment_Date
e s
201 John Doe 15-09-2020 85
202 Jane Smith 10-05-2019 90 (4)
Johnso
203 Alex 22-11-2021 75
n
204 Emily Davis 30-01-2022 60
Micha
205 Brown 17-08-2018 95
el

Table: SUBJECTS

Sub_ID S_ID SubName Credits


301 201 Mathematics 3
302 202 Science 4
303 203 History 2
304 204 Literature 3
305 205 Physics 4
306 Computer
201 Science 3
Write the following SQL queries:
(I) To display complete details (from both the tables) of those
students whose marks are greater than 70.
(II) To display the details of subjects whose credits are in the
range of 2 to 4 (both values included).
(III) To increase the credits of all subjects by 1 which have
"Science" in their subject names.
(IV) (A) To display names (FName and LName) of students
enrolled in the "Mathematics" subject.
(OR)
(B) To display the Cartesian Product of these two tables.

Ans : ( I )
SELECT * FROM STUDENTS S
JOIN SUBJECTS Sub ON S.S_ID = Sub.S_ID
WHERE S.Marks > 70;

Page: 19/25
(II)
SELECT *
FROM SUBJECTS
WHERE Credits BETWEEN 2 AND 4;
(III)
UPDATE SUBJECTS
SET Credits = Credits + 1
WHERE SubName LIKE '%Science%';
(IV) A:
SELECT FName, LName
FROM STUDENTS S
JOIN SUBJECTS Sub ON S.S_ID = Sub.S_ID
WHERE Sub.SubName =
'Mathematics'; OR
B:
SELECT *
FROM STUDENTS, SUBJECTS;

A table, named ELECTRONICS, in the PRODUCTDB database, has


35.
the following structure:

Field Type
productID int(11)
productName
varchar(20) price float
stockQty int(11)
(4)
Write the following Python function to perform the specified operation:

AddAndDisplay(): To input details of a product and store it in the


table ELECTRONICS. The function should then retrieve and display
all records from the ELECTRONICS table where the price is greater
than 150.
Assume the following for Python-Database
connectivity: Host: localhost
User: root
Password: Electro123

Ans :
import mysql.connector
def AddAndDisplay():
# Connect to the database
conn = mysql.connector.connect(
host='localhost',
user='root',
password='Electro123',
database='PRODUCTDB'
)
cursor = conn.cursor()
Page: 20/25
productID = int(input("Enter Product ID: "))

productName = input("Enter Product Name: ")


price = float(input("Enter Price: "))
stockQty = int(input("Enter Stock Quantity: "))
cursor.execute("INSERT INTO ELECTRONICS
(productID, productName,
price, stockQty) VALUES (%s,
%s, %s, %s)", (productID,
productName, price, stockQty))
conn.commit()
cursor.execute("SELECT * FROM ELECTRONICS
WHERE price > 150")
records = cursor.fetchall()
print("\nRecords with price greater than 150:")
for record in records:
print(record)
cursor.close()
conn.close()|
(1 Mark for Declaration of correct Connection Object
+ 1 Mark for correct input + 1 marks for correctly
using execute( ) method + 1 marks for showing
output using loop )

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


Raj is a supervisor at a software development company. He needs
36.
to manage the records of various employees. For this, he wants
the following information of each employee to be stored:
Employee_ID – integer
Employee_Name – string
Position – string
Salary – float (5)
You, as a programmer of the company, have been assigned to do
this job for Raj.
(I) Write a function to input the data of an employee and append it
to a binary file.
(II) Write a function to update the data of employees whose salary
is greater than 50000 and change their position to "Team Lead".
(III)Write a function to read the data from the binary file and
display the data of all those employees who are not "Team Lead".

Ans : (I)
import pickle
def add_employee(filename):
employee_id = int(input("Enter Employee ID: "))
employee_name = input("Enter Employee Name: ")
position = input("Enter Position: ")
salary = float(input("Enter Salary: "))
new_employee = (employee_id, employee_name, position, salary)
with open(filename, 'ab') as file:
pickle.dump(new_employee, file)
Page: 21/25
(1/2 mark for input + 1 mark for correct use of dump( ) to add new emp

data)
(II)
def update_employee(filename):
employees = []
with open(filename, 'rb') as file:
try:
while True:
employees.append(pickle.load(file))
except EOFError:
pass
for i in range(len(employees)):
if employees[i][3] > 50000:
employees[i] = (employees[i][0], employees[i][1], "Team Lead",
employees[i][3])
with open(filename, 'wb') as file:
for employee in employees:
pickle.dump(employee, file)
(1 mark for correct use of load( ) method to retrieve data + 1/2 mark for
correct loop + 1/2 mark for correct condition within loop )

(III)
def display_non_team_leads(filename): print("\
nEmployees who are not Team Leads:") with
open(filename, 'rb') as file:
try:
while True:
employee = pickle.load(file)
if employee[2] != "Team Lead":
print(f"ID: {employee[0]}, Name: {employee[1]}, Position:
{employee[2]}, Salary: {employee[3]}")
except EOFError:
pass
( 1 mark for correct use of Try except block and 1/2 mark for correct
use of while loop )

Page: 22/25
Interstellar Logistics Ltd. is an international shipping company.
37. They are planning to establish a new logistics hub in Chennai, with
the head office in Bangalore. The Chennai hub will have four
buildings - OPERATIONS, WAREHOUSE, CUSTOMER_SUPPORT, and
MAINTENANCE. As a
network specialist, your task is to propose the best networking
solutions to address the challenges mentioned in points (I) to (V),
considering the distances between the various buildings and the
given requirements.

(5)

Building-to-Building Distances (in meters):

From To
Distance OPERATIONS
WAREHOUSE 40 m
OPERATIONS CUSTOMER_SUPPORT 90 m
OPERATIONS MAINTENANCE 50 m
WAREHOUSE CUSTOMER_SUPPORT 60 m
WAREHOUSE MAINTENANCE 45 m
CUSTOMER_SUPPORT MAINTENANCE 55 m

Distance of Bangalore Head Office from Chennai Hub: 1300

km Number of Computers in Each Building/Office:

Location

Computers OPERATIONS 40
WAREHOUSE 20
CUSTOMER_SUPPORT 25
MAINTENANCE 22
BANGALORE HEAD OFFICE 15

Page: 23/25
(I) Suggest the most suitable location for the server within the
Chennai hub. Justify your decision.

(II) Recommend the hardware device to connect all computers


within each building efficiently.

(III) Draw a cable layout to interconnect the buildings at the


Chennai hub efficiently. Which type of cable would you
recommend for the fastest and most reliable data transfer?

(IV) Is there a need for a repeater in the proposed cable layout?


Justify your answer.

(V) A) Recommend the best option for live video communication


between the Operations Office in the Chennai hub and the
Bangalore Head Office from the following choices:

 a) Video Conferencing
 b) Email
 c) Telephony
 d) Instant Messaging
OR

(V) B) What type of network (PAN, LAN, MAN, or WAN) would


be set up among the computers within the Chennai hub?

Ans :
(I) The server should be placed in the OPERATIONS
building. Justification:

 It has the largest number of computers (40), making it the


most central location in terms of the network load.
 The distances to other buildings are relatively short,
ensuring efficient data transfer.(1 Mark)

(II) A switch should be used within each building to connect all


computers. A switch is ideal for creating a local area network
(LAN) and ensures efficient communication between devices in a
single building. ( 1 Mark)

(III) The most efficient cable layout would involve connecting


the buildings as follows:

 OPERATIONS to WAREHOUSE (40 m)


 OPERATIONS to MAINTENANCE (50 m)
 OPERATIONS to CUSTOMER_SUPPORT (90 m)
 WAREHOUSE to MAINTENANCE (45 m)
 WAREHOUSE to CUSTOMER_SUPPORT (60 m)

Page: 24/25
CUSTOMER_SUPPORT

(90 m)

OPERATIONS

/ | \

(40 m) (50 m) (60 m)

/ | \

WAREHOUSE MAINTENANCE

Cable Recommendation: Fiber optic cable is recommended for high-


speed data transfer and reliable communication over distances. It
offers better bandwidth and lower signal degradation over long
distances than copper cables. ( 1/2 + 1/2 mark)

(III) There is no need for a repeater in this layout. The maximum


distance between any two buildings is 90 meters, which is well
within the 100-meter limit for Ethernet cable or fiber optics
before requiring a repeater.

( 1 mark )

(IV) A) The best option for live communication between the Chennai
Operations Office and the Bangalore Head Office would be Video
Conferencing. This allows real-time face-to-face meetings and
visual communication across long distances, which is ideal for
inter-office collaboration.

OR

(V) B) The network type in the Chennai hub would be a LAN (Local
Area Network), as all computers are located within a confined
geographical area (the logistics hub) and are connected to each other
for data communication within the same campus.

(1 mark for any correct part solution )

Page: 25/25

You might also like