Skip to content

About

A console-based Employee Management System built with C++, featuring employee insertion, searching, updating, and file handling.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Employee Management System (C++)

A simple console-based Employee Management System developed using C++. This project demonstrates basic programming concepts, file handling, structures, functions, and CRUD operations using text files.

Features

  • Insert Employee – Add a new employee with a name, department, and salary.
  • Search Employee – Find an employee using their ID.
  • Update Employee – Modify existing employee details.
  • View All Employees – Display all stored employee records.
  • Automatic Employee ID Generation – Generate a new ID based on the highest existing employee ID.
  • File Handling – Store employee records in a local text file.
  • Menu-Driven Interface – Navigate through the system using a simple console menu.

Technologies Used

  • C++
  • Standard C++ Library
  • File Handling (ifstream, ofstream)
  • String Processing (stringstream)
  • Text File Storage

Project Structure

employee-management-system/
├── src/
│   └── main.cpp
├── data/
│   └── .gitkeep
├── .gitignore
├── LICENSE
└── README.md

Requirements

  • A C++ compiler such as GCC or MinGW
  • Visual Studio Code or another C++ development environment
  • A terminal or command prompt

How to Run

1. Clone the Repository

git clone https://github.com/thisum-gamage/employee-management-system.git

2. Navigate to the Project Directory

cd employee-management-system

3. Compile the Program

g++ -std=c++17 src/main.cpp -o employee-management

4. Run the Program

On Windows:

.\employee-management.exe

On Linux or macOS:

./employee-management

Run the program from the project root directory so that the relative data file paths work correctly.

Data Storage

Employee records are stored locally in data/employees.txt.

The records use a comma-separated format:

1,John Smith,IT,75000
2,Jane Doe,HR,65000

The program creates or appends to the employee data file when inserting records, provided the data directory exists.

Concepts Demonstrated

  • Structures (struct)
  • Functions and modular programming
  • Loops and conditional statements
  • File input and output
  • String streams and parsing
  • Automatic ID generation
  • Searching and updating records
  • Temporary files for record updates
  • Basic CRUD operations

Limitations

  • This is a beginner-level console application.
  • Data is stored in a local text file rather than a database.
  • Input validation and malformed-record handling can be improved.
  • Commas in employee names or department names are not supported by the current storage format.
  • The application does not include authentication or multi-user access control.

Future Improvements

  • Add employee deletion functionality.
  • Improve input validation and error handling.
  • Add sorting and filtering options.
  • Introduce a database such as SQLite.
  • Improve the console interface.
  • Add automated tests.

License

This project is distributed under the MIT License. See the LICENSE file for details.

About

A console-based Employee Management System built with C++, featuring employee insertion, searching, updating, and file handling.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages