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.
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
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?"
Features to Implement
- 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
- 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
- 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
- Clear, intuitive menu system
- Input validation with helpful error messages
- Confirmation prompts for destructive actions
- Formatted output for easy reading
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 Schema
| Column | Type | Description |
|---|---|---|
student_id | String | Unique student identifier (e.g., STU0001-STU1000) |
gender | String | Student gender (female, male) |
race_ethnicity | String | Ethnicity group (group A, B, C, D, E) |
parental_education | String | Parent's education level (6 levels) |
lunch | String | Lunch type (standard, free/reduced) |
test_prep | String | Test preparation course (none, completed) |
math_score | Integer | Math exam score (0-100) |
reading_score | Integer | Reading exam score (0-100) |
writing_score | Integer | Writing exam score (0-100) |
total_score | Integer | Sum of all three scores (0-300) |
average_score | Float | Average of three scores (0.00-100.00) |
grade | String | Letter grade (A, B, C, D, F) |
| Column | Type | Description |
|---|---|---|
dept_code | String | Department code (CS, EE, ME, CE, BIO) |
dept_name | String | Full department name |
building | String | Department building location |
head | String | Department head name |
| Column | Type | Description |
|---|---|---|
course_id | String | Course identifier (e.g., CS101) |
course_name | String | Course title |
department | String | Offering department |
credits | Integer | Credit hours (1-4) |
instructor | String | Course instructor name |
Sample Data Preview
Here is what typical student records look like from the Kaggle dataset:
| ID | Gender | Race | Parent Edu | Lunch | Test Prep | Math | Reading | Writing | Grade |
|---|---|---|---|---|---|---|---|---|---|
| STU0001 | female | group B | bachelor's degree | standard | none | 72 | 72 | 74 | B |
| STU0002 | female | group C | some college | standard | completed | 69 | 90 | 88 | B |
| STU0003 | male | group D | master's degree | standard | none | 87 | 93 | 91 | A |
Project Requirements
Your project must include all of the following components. Structure your code with clear organization and documentation.
Data Structure Design
Student Structure:
- Create a
Studentstruct 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
};
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
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)
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()andleft/rightfor alignment - Color output (optional, use ANSI codes)
Feature Specifications
Implement the following features with the specified behavior. Each feature should be accessible from the main menu.
- 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
- 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
- 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)
- Find: Search by Student ID
- Display: Show current values
- Select: Choose field to update
- Validate: Check new value
- Save: Update vector and file
- Find: Search by Student ID
- Display: Show student details
- Confirm: Ask "Are you sure? (Y/N)"
- Remove: Delete from vector
- Save: Update file
- 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): _
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();
};
Submission Requirements
Create a public GitHub repository with the exact name shown below:
Required Repository Name
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
Enter your GitHub username - we will verify your repository automatically
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
Exceeds all requirements with exceptional quality
Good
Meets all requirements with good quality
Satisfactory
Meets minimum requirements
Needs Work
Missing key requirements
Ready to Submit?
Make sure you have completed all requirements and reviewed the grading rubric above.
Submit Your ProjectPre-Submission Checklist
Use this checklist to verify you have completed all requirements before submitting your project.