Student Management System: Name: Roch Ahron M. Balberona Bscpe 2 - H3 Instructor: Engr. Julian N. Semblante
Student Management System: Name: Roch Ahron M. Balberona Bscpe 2 - H3 Instructor: Engr. Julian N. Semblante
BSCPE 2 - H3
3.File Handling Libraries in C# (System.IO): The program relies on the System.IO namespace for managing files,
specifically for operations like creating, reading, writing, and updating text files.
Additional Libraries Used:
System.Collections.Generic: Used for managing collections, such as Dictionary, List, and Queue that store student
data
System.Linq: Provides easy querying of collections and LINQ methods for filtering, selecting, and transforming
data.
System.Text: Useful for manipulating text data (though not heavily used in the current context, it's often used for
efficient string operations).
FEATURES AND FUNCTIONALITIES
Create new files and directories:
The program creates and saves student data files using File.WriteAllText().
Example: Student records are saved to ensure data persistence.
Reading a File
Method Used: File.ReadAllText()
Purpose: Reads the content of the file to load student data into the program for processing.
Updating a File
Method Used: File.WriteAllText()
Purpose: After making changes (like adding or deleting students), the file is overwritten with the
updated data.
FILE-HANDLING OPERATIONS IN DETAIL
Deleting a File
Method Used: Not directly used in your program.
Purpose: Instead of deleting the file, student records are removed from the in-memory
collection (using studentAccounts.Remove(id)), and the updated data is saved back to the file.
Exception Management:
Problem: Handling unexpected errors during file operations or student data processing.
Solution: Wrapped file operations in try-catch blocks to catch exceptions such as IOException or deserialization errors.
Provided user-friendly error messages, like “Error reading file” or “Error saving students to file,” and ensured that the
application doesn’t crash, making it more resilient.
TEST AND RESULTS
BENEFITS AND APPLICATIONS
In the "Student Management System", file handling offers several advantages for managing
student data efficiently and persistently. The system allows for easy saving and retrieval of
student information like IDs, names..etc by writing to and reading from a file. This file-based
approach ensures that data is retained across sessions, enabling users to load, update, or
delete student records without needing a complex database setup.
The benefits of using file handling in this system include simplicity, low resource usage, and
cost-effectiveness. It is ideal for small-scale systems where complex database solutions are
not necessary. Real-world applications of file handling, as demonstrated in this project,
include student management in educational institutions and creating user-friendly systems
for small schools or organizations that need a reliable way to store and manage data, all
while minimizing overhead costs. This system provides a flexible, straightforward solution to
data storage and management tasks, making it a valuable tool for educational
environments.
FUTURE ENHANCEMENTS
GUI Interface: Adding a graphical interface for more intuitive user interaction.
Database Integration: Integrating with a relational database such as SQL (e.g., MySQL or
SQL Server) for more advanced data management, querying, and scalability.
Advanced File Parsing: Supporting formats like JSON or XML for structured, flexible data
storage.
CONCLUSION
The Student Management System successfully meets the goal of managing student
data through simple file handling. Key achievements include the ability to load,
save, and update student records, as well as implement basic error handling to
ensure data integrity. The project highlighted the importance of validating data
before writing it to a file and handling exceptions to prevent crashes. One of the
main takeaways is the practicality of using file handling in small-scale systems for
easy data management without the overhead of complex databases. The project
also reinforced the significance of error handling, ensuring that user data is
processed correctly and safely.