Capstone Project

Student Database Management System

Build a complete student records management system using C++. You will implement file handling for persistent storage, create data structures for student records, and build a menu-driven interface with full CRUD (Create, Read, Update, Delete) operations.

8-12 hours
Intermediate
500 Points
What You Will Build
  • Student record structure (struct/class)
  • File I/O for data persistence
  • CRUD operations (Add, View, Edit, Delete)
  • Search and filter functionality
  • Menu-driven console interface
Contents
01

Project Overview

This capstone project brings together everything you have learned in the C++ course. You will work with the famous Kaggle Students Performance Dataset containing 1,000 real student records with demographics, parental education levels, test preparation status, and exam scores across math, reading, and writing. Your goal is to build a professional student database management system that can store, retrieve, update, and delete student records using file handling for persistent storage.

Skills Applied: This project tests your proficiency in C++ structs/classes, file I/O (fstream), vectors, string manipulation, input validation, and menu-driven programming.
Data Structures

Design Student struct/class with proper data members

File Handling

Read/write CSV or binary files for data persistence

CRUD Operations

Create, Read, Update, Delete functionality

Console UI

Menu-driven interface with input validation

Learning Objectives

Technical Skills
  • Design and implement custom data structures (struct/class)
  • Use file streams (ifstream, ofstream, fstream) effectively
  • Parse and generate CSV formatted data
  • Implement search and sort algorithms
  • Handle errors and validate user input
Software Design Skills
  • Organize code into logical functions and modules
  • Write clean, readable, and maintainable code
  • Implement proper error handling strategies
  • Create user-friendly console interfaces
  • Document code with meaningful comments
Ready to submit? Already completed the project? Submit your work now!
Submit Now
02

Project Scenario

TechVarsity University

You have been hired as a Junior Software Developer at TechVarsity University, a growing educational institution with multiple departments. The administration currently manages student records using spreadsheets, which has become inefficient as enrollment grows. Your task is to build a console-based student database management system using C++.

"We need a simple yet powerful system to manage our student records. It should allow us to add new students, search for existing ones, update their information, and remove records when needed. The data must persist between program runs. Can you build us something that's easy to use from the command line?"

Dr. Sarah Chen, Director of Student Affairs

Features to Implement

Core Features
  • Add new student records with all required fields
  • View all students in a formatted table
  • Search students by ID, name, or department
  • Update existing student information
  • Delete student records with confirmation
Data Management
  • Load student data from CSV file on startup
  • Save changes to file automatically or on exit
  • Validate data integrity (unique IDs, valid emails)
  • Handle file errors gracefully
Advanced Features
  • Sort students by name, GPA, or enrollment date
  • Filter students by department or grade level
  • Calculate and display statistics (avg GPA, count per dept)
  • Export filtered results to a new file
User Experience
  • Clear, intuitive menu system
  • Input validation with helpful error messages
  • Confirmation prompts for destructive actions
  • Formatted output for easy reading
Pro Tip: Think like a software engineer! Plan your data structure and file format before coding. Consider edge cases like empty files, duplicate IDs, and invalid input.
03

The Dataset

You will work with the Kaggle Students Performance Dataset - a popular educational dataset containing 1,000 student records with demographic information, parental education levels, test preparation status, and exam scores across math, reading, and writing subjects. This real-world dataset is perfect for building a comprehensive student management system.

Dataset Download

Download the student data files (based on Kaggle's Students Performance Dataset) and save them to your project folder. The CSV files contain all the fields you need to manage student records.

Original Data Source

This project is inspired by the Students Performance Dataset from Kaggle - one of the most popular datasets for learning data analysis in education. The original dataset contains 1,000 student records with test scores, demographics, and educational background information from a public school system.

Dataset Info: 1,000 rows × 8 columns | Gender: Male/Female | Race/Ethnicity: 5 Groups | Parental Education: 6 Levels | Test Prep: Completed/None | Scores: Math, Reading, Writing (0-100) | Average Score: 66.09 | Pass Rate: 78.5%
Dataset Schema

ColumnTypeDescription
student_idStringUnique student identifier (e.g., STU0001-STU1000)
genderStringStudent gender (female, male)
race_ethnicityStringEthnicity group (group A, B, C, D, E)
parental_educationStringParent's education level (6 levels)
lunchStringLunch type (standard, free/reduced)
test_prepStringTest preparation course (none, completed)
math_scoreIntegerMath exam score (0-100)
reading_scoreIntegerReading exam score (0-100)
writing_scoreIntegerWriting exam score (0-100)
total_scoreIntegerSum of all three scores (0-300)
average_scoreFloatAverage of three scores (0.00-100.00)
gradeStringLetter grade (A, B, C, D, F)

ColumnTypeDescription
dept_codeStringDepartment code (CS, EE, ME, CE, BIO)
dept_nameStringFull department name
buildingStringDepartment building location
headStringDepartment head name

ColumnTypeDescription
course_idStringCourse identifier (e.g., CS101)
course_nameStringCourse title
departmentStringOffering department
creditsIntegerCredit hours (1-4)
instructorStringCourse instructor name
Sample Data Preview

Here is what typical student records look like from the Kaggle dataset:

IDGenderRaceParent EduLunchTest PrepMathReadingWritingGrade
STU0001femalegroup Bbachelor's degreestandardnone727274B
STU0002femalegroup Csome collegestandardcompleted699088B
STU0003malegroup Dmaster's degreestandardnone879391A
Data Quality Note: The Kaggle dataset is pre-cleaned, but your program should handle edge cases like missing fields, invalid scores, and filtering by various criteria efficiently.
04

Project Requirements

Your project must include all of the following components. Structure your code with clear organization and documentation.

1
Data Structure Design

Student Structure:

  • Create a Student struct or class with all required fields
  • Include appropriate data types for each field
  • Implement constructors (default and parameterized)
  • Add member functions for display and validation
struct Student {
    string studentId;      // STU0001 - STU1000
    string gender;         // female, male
    string raceEthnicity;  // group A-E
    string parentalEdu;    // education level
    string lunch;          // standard, free/reduced
    string testPrep;       // none, completed
    int mathScore;         // 0-100
    int readingScore;      // 0-100
    int writingScore;      // 0-100
    int totalScore;        // Calculated: sum of scores
    float averageScore;    // Calculated: average
    string grade;          // A, B, C, D, F
    
    // Constructor, display(), validate() methods
};
Deliverable: Well-designed Student struct/class with proper encapsulation.
2
File Handling

CSV File Operations:

  • Load: Read 1,000 students from Kaggle CSV file into vector on startup
  • Save: Write all student records back to CSV file
  • Parse: Handle CSV parsing with proper field extraction
  • Backup: Create backup before overwriting (optional)

Error Handling:

  • Handle file not found gracefully
  • Validate file format on load
  • Report parsing errors with line numbers
Deliverable: Robust file I/O functions that handle all edge cases.
3
CRUD Operations

Implement these core functions:

  • Create: Add new student with input validation
  • Read: View all students or search by criteria
  • Update: Modify existing student fields
  • Delete: Remove student with confirmation prompt

Additional Features:

  • Search by ID, gender, ethnicity, or grade
  • Sort by total score, average, or individual subjects
  • Filter by test prep status, lunch type, or parental education
  • Calculate statistics (average scores, pass rates, performance by group)
Deliverable: Complete CRUD functionality with search and sort.
4
User Interface

Menu System:

  • Clear main menu with numbered options
  • Sub-menus for complex operations (search, sort)
  • Input validation with error messages
  • Confirmation prompts for destructive actions

Display Formatting:

  • Formatted table output for student lists
  • Clear field labels for individual records
  • Use setw() and left/right for alignment
  • Color output (optional, use ANSI codes)
Deliverable: User-friendly console interface with proper formatting.
05

Feature Specifications

Implement the following features with the specified behavior. Each feature should be accessible from the main menu.

Add New Student
  • Auto-generate: Create unique Student ID (STU051, STU052...)
  • Input: Prompt for all required fields
  • Validate: Check GPA range (0-4), age (18-30), email format
  • Confirm: Display entered data and confirm before saving
  • Save: Add to vector and update file
View Students
  • All: Display all students in formatted table
  • Single: View detailed record by Student ID
  • Pagination: Show 10 students per page (optional)
  • Format: Use setw() for aligned columns
  • Summary: Show total count and average GPA
Search Students
  • By ID: Exact match search
  • By Name: Partial match (contains)
  • By Department: Filter by dept code
  • By Grade: Filter by year level
  • By GPA: Range search (min-max)
Update Student
  • Find: Search by Student ID
  • Display: Show current values
  • Select: Choose field to update
  • Validate: Check new value
  • Save: Update vector and file
Delete Student
  • Find: Search by Student ID
  • Display: Show student details
  • Confirm: Ask "Are you sure? (Y/N)"
  • Remove: Delete from vector
  • Save: Update file
Sort Students
  • By Name: Alphabetical (A-Z, Z-A)
  • By GPA: Highest to lowest, or reverse
  • By Age: Youngest to oldest, or reverse
  • By Date: By enrollment date
  • Display: Show sorted results
Sample Menu Output
╔══════════════════════════════════════════════════════════════╗
║           TECHVARSITY STUDENT MANAGEMENT SYSTEM              ║
╠══════════════════════════════════════════════════════════════╣
║  1. Add New Student                                          ║
║  2. View All Students                                        ║
║  3. Search Students                                          ║
║  4. Update Student                                           ║
║  5. Delete Student                                           ║
║  6. Sort Students                                            ║
║  7. Statistics                                               ║
║  8. Save and Exit                                            ║
╚══════════════════════════════════════════════════════════════╝
   Enter your choice (1-8): _
Best Practice: Implement features incrementally. Start with Add and View, then implement Search, Update, and Delete. Add sorting and statistics last.
06

Recommended Code Structure

Organize your code into multiple files for better maintainability. Here's the recommended project structure:

student-database-system/
├── src/
│   ├── main.cpp              # Entry point, main menu loop
│   ├── student.h             # Student struct/class definition
│   ├── student.cpp           # Student member function implementations
│   ├── database.h            # Database class (CRUD operations)
│   ├── database.cpp          # Database implementations
│   ├── filehandler.h         # File I/O functions
│   ├── filehandler.cpp       # File handling implementations
│   └── utils.h               # Utility functions (validation, formatting)
├── data/
│   ├── students_sample.csv   # Sample data file
│   ├── departments.csv       # Department data
│   └── backup/               # Backup files folder
├── screenshots/
│   ├── main_menu.png         # Screenshot of main menu
│   ├── add_student.png       # Screenshot of adding student
│   └── search_results.png    # Screenshot of search results
├── Makefile                  # Build instructions (optional)
└── README.md                 # Project documentation
Key Functions to Implement
// filehandler.h
vector<Student> loadFromCSV(string filename);
bool saveToCSV(string filename, vector<Student>& students);
bool createBackup(string filename);

// student.h
struct Student {
    // data members
    void display() const;
    bool validate() const;
    string toCSV() const;
    static Student fromCSV(string line);
};
// database.h
class StudentDatabase {
private:
    vector<Student> students;
    string filename;
public:
    void addStudent(Student s);
    Student* findById(string id);
    vector<Student> searchByName(string name);
    bool updateStudent(string id, Student s);
    bool deleteStudent(string id);
    void sortByGPA(bool ascending = false);
    void displayStats();
};
07

Submission Requirements

Create a public GitHub repository with the exact name shown below:

Required Repository Name
student-database-system
github.com/<your-username>/student-database-system
Required Project Structure
student-database-system/
├── src/
│   ├── main.cpp              # Main program entry point
│   ├── student.h             # Student class/struct header
│   ├── student.cpp           # Student implementations
│   ├── database.h            # Database operations header
│   ├── database.cpp          # Database implementations
│   └── utils.h               # Utility functions
├── data/
│   └── students_sample.csv   # Sample data file
├── screenshots/
│   ├── menu.png              # Main menu screenshot
│   ├── add.png               # Add student screenshot
│   └── search.png            # Search results screenshot
└── README.md                 # Project documentation
README.md Required Sections
1. Project Header
  • Project title and description
  • Your full name and submission date
  • Course and project number
2. Features
  • List of implemented features
  • CRUD operations description
  • Additional features (search, sort)
3. How to Compile
  • Compilation command (g++ ...)
  • Dependencies if any
  • Platform requirements
4. How to Run
  • Run command (./program)
  • Command line arguments if any
  • Data file location
5. Screenshots
  • Main menu screenshot
  • Key features in action
  • Use markdown image syntax
6. File Structure
  • Brief description of each file
  • Purpose of each class/function
  • Data file format
Do Include
  • All source code files (.cpp, .h)
  • Sample data file (students_sample.csv)
  • At least 3 screenshots
  • Comprehensive README.md
  • Compilation instructions
Do Not Include
  • Compiled binaries (.exe, .out)
  • IDE-specific files (.vscode, .idea)
  • Object files (.o)
  • Large data files (> 1MB)
  • Personal information in test data
Submit Your Project

Enter your GitHub username - we will verify your repository automatically

08

Grading Rubric

Your project will be graded on the following criteria. Total: 500 points.

Criteria Points Description
Data Structure Design 75 Well-designed Student struct/class with proper members and methods
File Handling 100 Robust CSV reading/writing with error handling
CRUD Operations 125 All Create, Read, Update, Delete operations working correctly
Search and Sort 75 Multiple search criteria and sorting options
User Interface 50 Clear menu, formatted output, input validation
Code Quality 50 Clean code, comments, proper naming, modular design
Documentation 25 README quality, screenshots, compilation instructions
Total 500
Grading Levels
Excellent
450-500

Exceeds all requirements with exceptional quality

Good
375-449

Meets all requirements with good quality

Satisfactory
300-374

Meets minimum requirements

Needs Work
< 300

Missing key requirements

Ready to Submit?

Make sure you have completed all requirements and reviewed the grading rubric above.

Submit Your Project
09

Pre-Submission Checklist

Use this checklist to verify you have completed all requirements before submitting your project.

Code Requirements
Feature Requirements
UI Requirements
Repository Requirements
Final Check: Test your program on a fresh environment or different computer to ensure it compiles and runs without any dependencies on your local setup.