Skip to content

HieuStudyingCS/Student-Management-System-CPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UIT Student Management System (OOP & Safe File I/O)

A robust, terminal-based Student Management System developed in C++. This project transitioned from procedural structs to a full Object-Oriented Programming (OOP) architecture. It is designed to safely handle large datasets with built-in fault tolerance.

🚀 Key Features

  • Safe File I/O & Exception Handling: Automatically parses data.csv to load hundreds of student records. Uses try/catch blocks (std::invalid_argument, std::out_of_range) to gracefully skip corrupted or non-numeric CSV lines without crashing the program.
  • Input Buffer Clearing: Implemented robust std::cin validation to prevent infinite loops when users input strings instead of numeric data.
  • Dynamic Semester Tracking: Maps courses to exact semesters based on cohort admission years using the std::map data structure.
  • SOLID Principles: * Utility functions are isolated in static classes.
    • Employs the Strategy Pattern for scalable sorting logic (currently sorts by Student ID via overloaded < operator).

📁 Project Structure

📦 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

📖 Usage Guide

Upon execution, the system automatically attempts to read the data.csv file located in the root directory.

  1. Auto-Loading: The terminal will display the number of successfully loaded students and report any skipped lines due to formatting errors.

  2. 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.

  3. Exit: Type 0 when prompted for a Student ID to safely terminate the program.

📊 Mock Data Format

  • The included data.csv must follow this exact header structure (comma-separated):
MSSV,Khoa,HoTen,NgaySinh,ThuTuHocKy,TenHocKy,MaMon,TinChi,GPA

🐍 Data Generation Script (Optional)

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.

How to generate your own dataset:

  1. Ensure you have Python installed on your system.
  2. Open your terminal in the project root directory.
  3. Run the script:
    python generate_data.py

(Note: Use python3 on macOS/Linux if required).

  • The script will automatically output a fresh data.csv file, 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.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors