Section E
Section E
SECTION-E
36. Rohit is a librarian managing a library's database. The database stores
information about books with the following fields:
Book_ID (integer)
Book_Title (string)
Author (string)
Copies_Available (integer)
You, as a programmer, need to:
i) Write a function add_book(file_name) to input the data of a book and
append it to a binary file.
ii) Write a function update_availability(file_name) to update the number of
copies available for a book if the Copies_Available is less than 5. Add 5
more copies to the existing count.
iii) Write a function read_books(file_name) to display details of books
where the Copies_Available is greater than 10.
Ans: import pickle
i) Suggest the most appropriate location of the server within the Chennai
campus. Justify your choice.
ii) Recommend a network device to connect all the computers in each
building.
iii) Design the cable layout to efficiently connect the buildings within the
Chennai campus and suggest the best type of cable for high-speed data
transfer.
iv) State whether a repeater is required in your cable layout. Provide a
justification.
v) Recommend a solution for live video communication between the
Chennai campus and the Bangalore Head Office. Choose from the
following options:
a. Email
b. Telephony
c. Video Conferencing
d. Instant Messaging
vi) Identify the type of network (PAN, LAN, MAN, or WAN) within:
a) Chennai Campus
b) Between Chennai Campus and Bangalore Head Office
Ans: i) Server Location:The DEVELOPMENT building is the most appropriate
location for the server since it has the highest number of computers (40).
Placing the server here minimizes network congestion and ensures efficient
data transfer.
ii) Network Device: A Switch is recommended to connect the computers
within each building as it efficiently manages traffic and supports high-speed
connectivity
iii) Cable Layout and Type:
Layout: Draw a star topology where each building (HR,
DEVELOPMENT, TESTING) is connected to a central switch in the
DEVELOPMENT block.
Cable Type: Use CAT-6 Ethernet cables for short distances and fiber-optic
cables for faster and reliable data transfer between blocks.
iv) Repeater Requirement: No repeater is required for the given layout as all
inter-building distances are under 100 meters, which is within the range of
CAT-6 and fiber-optic cables.
v) Live Video Communication Recommendation: Video Conferencing is the
best option for live visual communication between Chennai campus and
Bangalore Head Office, as it supports real-time interaction over long
distances.
vi) Network Types:
Within Chennai Campus: Local Area Network (LAN).
Between Chennai and Bangalore: Wide Area Network (WAN).
36. Dr. Meera is managing patient records in a hospital. The patient records include
the following details:
Patient_ID (integer)
Patient_Name (string)
Disease (string)
Days_Admitted (integer)
Tasks:
1. Write a function add_patient(file_name) to input and append patient
details to a binary file.
2. Write a function update_discharge(file_name) to update patient records
and discharge those whose Days_Admitted is greater than 20 by adding
"Discharged" to their record.
3. Write a function read_active_patients(file_name) to display the details of
patients who are still admitted.
Ans: import pickle
i) Suggest the most suitable block to house the server. Justify your answer.
ii) Draw the topology to connect all the blocks within the campus. Mention the
cable type you would recommend.
iii) Which device is best suited to connect computers within a block? Justify
your answer.
iv) Is a repeater required in the given network layout? Why or why not?
v) Identify the type of network (LAN, MAN, or WAN) within the campus and
between this campus and their Mumbai branch, which is 400 km away.
Ans: i) Suitable block to house the server:
The IT block should house the server as it has the maximum number of
computers (50), which will reduce the overall network traffic and ensure
faster data access for the most active users.
ii) Topology and recommended cable type:
Suggested Topology: Star topology. It ensures centralized connectivity
with the server located in the IT block.
Recommended Cable Type: Cat-6 Ethernet cable (supports higher
speeds over short distances).
iii) Device to connect computers within a block:
Use a switch to connect all computers within each block. A switch offers
better performance as it sends data only to the intended device.
iv) Is a repeater required?
A repeater is not required because the distances between blocks are less
than 100 meters, which is well within the range of Ethernet cables.
v) Network types:
Within the campus: LAN (Local Area Network).
Between Mumbai campus and Delhi head office: WAN (Wide Area
Network).
36. Karan is responsible for maintaining an inventory system for a store. The
inventory includes:
Item_ID (integer)
Item_Name (string)
Category (string)
Quantity (integer)
Tasks:
i) Write a function add_item(file_name) to input and append inventory
items to a binary file.
ii) Write a function update_stock(file_name) to increase the quantity of all
items under the "Electronics" category by 10.
iii) Write a function read_low_stock(file_name) to display all items whose
Quantity is less than 20.
Ans:
37. A college in Kolkata is setting up a network in its campus with the following
building distances and computer distribution:
36. Amit is managing employee records for his company. The employee data
includes:
Employee_ID (integer)
Employee_Name (string)
Department (string)
Salary (float)
Tasks:
i) Write a function add_employee(file_name) to input and append employee
data to a binary file.
ii) Write a function update_salary(file_name) to increase the salary of all
employees in the "IT" department by 15%.
iii) Write a function read_low_salary(file_name) to display details of
employees whose salary is below 30,000.
Ans:
37. A hospital is planning to network its buildings. The layout is as follows:
36. Priya is responsible for managing student results. The result records include:
Roll_Number (integer)
Student_Name (string)
Subject (string)
Marks (integer)
Tasks:
1. Write a function add_result(file_name) to input and append student result
data to a binary file.
2. Write a function update_grade(file_name) to add a grade ("A", "B", "C",
etc.) based on the Marks scored by the student.
3. Write a function read_failed_students(file_name) to display the details of
students who scored less than 40 marks.
Ans:
37. A school in Ahmedabad has the following buildings to be networked:
i) Which building is the most suitable to host the central server? Explain your
answer.
ii) Suggest a topology and draw a layout for connecting all buildings.
iii) Recommend a suitable hardware device for connecting all computers in a
single building.
iv) Which cable type would you prefer for inter-building connections and why?
v) What type of network would be established within the campus and why?
Ans: i) Building for the server: The LABS block should house the server
because it has the maximum number of computers (50).
ii) Topology: Star topology is recommended to ensure better performance
and centralized control.
iii) Device for connecting computers within a block: Use a switch for
internal block connectivity.
iv) Cable type for inter-building connections: Use Cat-6 Ethernet cables
for distances up to 100 meters, and fiber optic cables for longer distances.
v) Network type:
Within the campus: LAN (Local Area Network).