A practical, terminal-based Student Management System built with C++. The project started from a procedural approach and was later refactored into a full OOP design. It is made to work smoothly with large CSV datasets, even when some rows are messy or invalid.
- Safe CSV loading: Reads
data.csvautomatically and can load hundreds of student records. If a row is broken or contains invalid numbers, the program skips that row and keeps running. - Friendly input handling: Uses solid
std::cinvalidation so invalid input (for example, typing text where a number is expected) does not trap the app in an infinite loop. - Semester mapping that makes sense: Uses
std::mapto match each course to the correct semester based on the student's admission year. - Clean OOP structure: Utility logic is separated into dedicated static classes, and sorting is implemented with the Strategy Pattern (currently sorting by Student ID via overloaded
<).
📦 Quan_li_sinh_vien_class
┣ 📂 src
┃ ┣ 📄 Course.h # Represents a registered course
┃ ┣ 📄 main.cpp # Application entry point and UI loop
┃ ┣ 📄 Semester.h # Represents a semester containing multiple courses
┃ ┣ 📄 SortStrategy.h # Interface and concrete classes for Strategy Pattern
┃ ┣ 📄 Student.h # Student entity with overloaded operators
┃ ┣ 📄 StudentManager.h # Business logic and state management
┃ ┗ 📄 Utils.h # Utility classes (Date formatting, Validation)
┣ 📄 .gitignore # Specifies untracked compiled files
┣ 📄 data.csv # Sample dataset generated by the Python script
┣ 📄 generate_data.py # Python automation script to generate mock CSV data
┗ 📄 README.md # Project documentation
Upon execution, the system automatically attempts to read the data.csv file located in the root directory.
-
Auto-Loading: The terminal will display the number of successfully loaded students and report any skipped lines due to formatting errors.
-
Search Mode: Enter a valid 8-digit Student ID to retrieve the profile.
-
If found, specify the Semester Number (1-8) to view detailed transcripts (Course IDs, Credits, GPA).
-
Type any non-numeric character or an invalid semester to trigger the system's safe-fail warnings.
-
-
Exit: Type 0 when prompted for a Student ID to safely terminate the program.
- The included
data.csvmust follow this exact header structure (comma-separated):
MSSV,Khoa,HoTen,NgaySinh,ThuTuHocKy,TenHocKy,MaMon,TinChi,GPA
To demonstrate the system's ability to handle large datasets, a Python automation script (generate_data.py) is included in the root directory. This script dynamically generates a massive data.csv file containing hundreds of mock students with randomized but structurally accurate academic records.
- Ensure you have Python installed on your system.
- Open your terminal in the project root directory.
- Run the script:
python generate_data.py
(Note: Use python3 on macOS/Linux if required).
- The script will automatically output a fresh
data.csvfile, ready to be parsed by the C++ application. You can easily modify the num_students variable inside the Python file to stress-test the C++ application with thousands of records.