1.
Transaction Processing System (TPS)
Definition: TPS is responsible for handling routine, day-to-day
transactions like sales, payroll, or order processing.
Purpose: It automates repetitive tasks to ensure efficiency and accuracy.
Example: A supermarket's point-of-sale (POS) system—when a
cashier scans items, the system updates inventory and processes the
payment.
2. Management Information System (MIS)
Definition: MIS processes data from TPS and converts it into meaningful
information for middle managers.
Purpose: Helps in monitoring, controlling, and decision-making.
Example: A sales reporting system—a retail company generates
monthly reports to track sales performance in different regions.
3. Decision Support System (DSS)
Definition: DSS helps in making complex decisions by analyzing data,
simulating outcomes, and suggesting alternatives.
Purpose: Assists in planning and strategy.
Example: A hospital bed allocation system—it helps hospital
administrators predict patient admission rates and allocate resources
accordingly.
4. Executive Support System (ESS)
Definition: A specialized type of DSS designed for top executives to
support high-level decision-making.
Purpose: Provides summaries, forecasts, and insights based on internal
and external data.
Example: A CEO dashboard in a multinational company—it displays
company performance metrics, market trends, and financial summaries.
5. Office Automation System (OAS)
Definition: Uses computers and communication technology to enhance
office productivity.
Purpose: Automates document handling, communication, and scheduling.
Example: Microsoft Office 365 or Google Workspace—used for email,
document editing, video conferencing, and calendar management.
Encapsulation in Python
Introduction
Encapsulation is one of the fundamental principles of Object-Oriented
Programming (OOP). It is the process of hiding data and methods inside a class
and only allowing controlled access using methods. Encapsulation ensures that
data is not modified accidentally and improves code security.
Python achieves encapsulation using:
1. Public Members – Accessible from anywhere.
2. Protected Members – Should be accessed only inside the class or
subclasses.
3. Private Members – Not accessible directly from outside the class.
1. Public Members
Definition: Public members are accessible from anywhere, both inside and
outside the class.
Example Code (Students can try this)
class PublicExample:
def __init__(self):
self.public_var = "I am Public"
def public_method(self):
return f"Public Method: {self.public_var}"
# Creating object
obj = PublicExample()
# Accessing public members
print(obj.public_var) # Works
print(obj.public_method()) # Works
Expected Output:
I am Public
Public Method: I am Public
2. Protected Members
Definition: Protected members are prefixed with a single underscore (_). By
convention, they should not be accessed outside the class but are accessible in
subclasses.
Example Code (Students can try this)
class ProtectedExample:
def __init__(self):
self._protected_var = "I am Protected"
def get_protected(self):
return self._protected_var
def set_protected(self, new_value):
self._protected_var = new_value
# Creating object
obj = ProtectedExample()
# Accessing protected member (allowed but discouraged)
print("Before modification:", obj.get_protected())
# Modifying protected member using method
obj.set_protected("New Protected Value")
print("After modification:", obj.get_protected())
Expected Output:
Before modification: I am Protected
After modification: New Protected Value
Key Takeaways:
Protected members should only be accessed via methods.
They can be accessed directly but it's not recommended.
3. Private Members
Definition: Private members are prefixed with a double underscore (__). They
cannot be accessed directly from outside the class.
Example Code with Error (Students can try this)
class PrivateExample:
def __init__(self):
self.__private_var = "I am Private"
# Creating object
obj = PrivateExample()
# Trying to access private member directly (This will cause an error)
print(obj.__private_var) # ❌ Raises AttributeError
Expected Error:
AttributeError: 'PrivateExample' object has no attribute '__private_var'
4. Fixing the Private Member Access Issue
To access private members, we need to use getter and setter methods.
Fixed Code (Students can try this)
class PrivateExample:
def __init__(self):
self.__private_var = "I am Private"
def get_private(self):
return self.__private_var
def set_private(self, new_value):
self.__private_var = new_value
# Creating object
obj = PrivateExample()
# Accessing private member using method
print("Before modification:", obj.get_private())
# Modifying private member using method
obj.set_private("New Private Value")
print("After modification:", obj.get_private())
Expected Output:
Before modification: I am Private
After modification: New Private Value
Key Fix:
Instead of print(obj.__private_var), use print(obj.get_private()).
Instead of obj.__private_var = "New Value", use
obj.set_private("New Value").
5. Summary Table
Member
Prefix Direct Access? Proper Access Method
Type
Public No underscore (var) ✅ Yes Directly accessible
Single underscore ✅ Yes (but Use getter and setter
Protected
(_var) discouraged) methods
Double underscore Must use getter and setter
Private ❌ No (causes error)
(__var) methods
6. Conclusion
Encapsulation ensures data security and prevents accidental
modification.
Use public members for unrestricted access.
Use protected members when access should be limited to the
class and subclasses.
Use private members for strict data hiding, ensuring access only
through methods.
This module provides a structured way to introduce encapsulation in Python
with hands-on coding exercises for students. 😊