Employee Management System using c++ With Source Code

Employee Record Management System using C++

Introduction:

Employee Management System the whole project is designed in ‘C++’ language. This project manages the employee records working in a company such as personal information, work information, and contact info. This project is easy to operate and understood by the users. it is based on the concept to store and generate all the records of the Employee. It enables you to create, read, modify, and delete Employee Records. It includes the idea of topics like structure, loops, arrays, if-else, switches, etc. in C++.

It helps the company Management to store Employee data and
make changes to it such as Show, Update, Delete, and Search.
The features of C++ programming language help here to manage data and apply logic to the programs

Source Code:

Get Discount on Top Educational Courses

Brand NameDiscount InformationCoupon Codes Link
Educative.io20% discount on Educative courses and plans
W3Schools20% discount on W3Schools courses
KodeKloud10% discount on KodeKloud courses and plans
GeeksforGeeks30% discount on GeeksforGeeks courses
Target Test Prep20% discount on Target Test Prep
Coding Ninjas₹5000 discount on Coding Ninjas courses
Skillshare40% discount on Skillshare
DataCamp50% discount on DataCamp
365 Data Science57% discount on 365 Data Science Plans
Get SmarterFlat 20% discount on Get Smarter courses
SmartKeedaFlat 40% discount on SmartKeeda courses
StackSocial20% discount on StackSocial courses
				
					// PROJECT: Employee Record Management System using C++
// Written by Nikhil

#include <iostream>
using namespace std;

string id[30], name[30], address[50], dob[30], mobile_no[30], doj[30], marstatus[30], workd[30], workl[40], ctc[30], socialins[30], email[30]; // arrays for storing students data.

int total = 0; // to store all data
void enter()

{

    int ch = 0;

    cout << "How Many Employees' Data Do You Want to Enter?" << endl;

    cin >> ch;
    if (total == 0)

    {

        total = ch + total;

        for (int i = 0; i < ch; i++)

        {

            cout << "\nEnter the Data of Employee " << i + 1 << endl
                 << endl;
            cout << "** PERSONAL DETAILS **" << endl
                 << endl;

            cout << "Enter Name: " << endl;

            cin >> name[i];

            cout << "Enter Address: " << endl;

            cin >> address[i];

            cout << "Enter Date of Birth: " << endl;

            cin >> dob[i];

            cout << "Is Employee Married?: " << endl;

            cin >> marstatus[i];

            cout << "** WORK DETAILS **" << endl
                 << endl;

            cout << "Enter Id: " << endl;

            cin >> id[i];

            cout << "Enter Date of Joing: " << endl;

            cin >> doj[i];

            cout << "Work Department: " << endl;

            cin >> workd[i];

            cout << "Enter Work Location: " << endl;

            cin >> workl[i];

            cout << "Enter CTC: " << endl;

            cin >> ctc[i];

            cout << "Enter Social Insurance Id: " << endl;

            cin >> socialins[i];

            cout << "** CONTACT DETAILS **" << endl
                 << endl;

            cout << "Enter Mobile NO: " << endl;

            cin >> mobile_no[i];

            cout << "Enter Email: " << endl;

            cin >> email[i];
        }
    }

    else

    {

        for (int i = total; i < ch + total; i++) // to store onward students' data rather than storing double data

        {

            cout << "\nEnter the Data of Employee " << i + 1 << endl
                 << endl;
            cout << "** PERSONAL DETAILS **" << endl
                 << endl;

            cout << "Enter Name: " << endl;

            cin >> name[i];

            cout << "Enter Address: " << endl;

            cin >> address[i];

            cout << "Enter Date of Birth: " << endl;

            cin >> dob[i];

            cout << "Is Employee Married?: " << endl;

            cin >> marstatus[i];

            cout << "** WORK DETAILS **" << endl
                 << endl;

            cout << "Enter Id: " << endl;

            cin >> id[i];

            cout << "Enter Date of Joing: " << endl;

            cin >> doj[i];

            cout << "Work Department: " << endl;

            cin >> workd[i];

            cout << "Enter Work Location: " << endl;

            cin >> workl[i];

            cout << "Enter CTC: " << endl;

            cin >> ctc[i];

            cout << "Enter Social Insurance Id: " << endl;

            cin >> socialins[i];

            cout << "** CONTACT DETAILS **" << endl
                 << endl;

            cout << "Enter Mobile NO: " << endl;

            cin >> mobile_no[i];

            cout << "Enter Email: " << endl;

            cin >> email[i];
        }

        total = ch + total; // making choice
    }
}

void show()

{

    if (total == 0)

    {

        cout << "No Data is Entered" << endl;
    }

    else
    {

        for (int i = 0; i < total; i++)

        {
            cout<<"** RESULT FOR SHOW DATA **"<<endl;

            cout << "\nData of Employee: " << i + 1 << endl
                 << endl;
            cout << "** PERSONAL DETAILS **" << endl
                 << endl;

            cout << "Full Name: " << name[i] << endl;
            cout << "Address: " << address[i] << endl;
            cout << "Date of Birth: " << dob[i] << endl;
            cout << "Maritual Status: " << marstatus[i] << endl
                 << endl;

            cout << "** WORK DETAILS **" << endl
                 << endl;

            cout << "Id: " << id[i] << endl;
            cout << "Date of Joing: " << doj[i] << endl;
            cout << "Work Department: " << workd[i] << endl;
            cout << "Work Location: " << workl[i] << endl;
            cout << "CTC: " << ctc[i] << endl;
            cout << "Social Insurance: " << socialins[i] << endl
                 << endl;

            cout << "** CONTACT DETAILS **" << endl
                 << endl;
            cout << "Mobile NO: " << mobile_no[i] << endl;
            cout << "Email Id: " << email[i] << endl;
        }
    }
}

void search()

{

    if (total == 0)

    {

        cout << "No data is entered" << endl;
    }

    else
    {

        string idd;

        cout << "Enter the id of Employee you want to Search: " << endl;

        cin >> idd;

        for (int i = 0; i < total; i++)

        {

            if (idd == id[i])

            {
                cout << "RESULT FOR EMPLOYEE ID: " << idd << endl;

                cout << "** PERSONAL DETAILS **" << endl
                     << endl;

                cout << "Full Name: " << name[i] << endl;
                cout << "Address: " << address[i] << endl;
                cout << "Date of Birth: " << dob[i] << endl;
                cout << "Maritual Status: " << marstatus[i] << endl
                     << endl;

                cout << "** WORK DETAILS **" << endl
                     << endl;

                cout << "Id: " << id[i] << endl;
                cout << "Date of Joing: " << doj[i] << endl;
                cout << "Work Department: " << workd[i] << endl;
                cout << "Work Location: " << workl[i] << endl;
                cout << "CTC: " << ctc[i] << endl;
                cout << "Social Insurance: " << socialins[i] << endl
                     << endl;

                cout << "** CONTACT DETAILS **" << endl
                     << endl;
                cout << "Mobile NO: " << mobile_no[i] << endl;
                cout << "Email Id: " << email[i] << endl;
            }
        }
    }
}

void update()

{

    if (total == 0)

    {

        cout << "No data is entered" << endl;
    }

    else
    {

        string rollno;

        cout << "Enter the Id of Employee which you want to update" << endl;

        cin >> rollno;

        for (int i = 0; i < total; i++)

        {

            if (rollno == id[i])

            {

                cout << "\nPrevious Data: " << endl
                     << endl;

                cout << "Data of Employee " << i + 1 << endl;

                cout << "** PERSONAL DETAILS **" << endl;

                cout << "Full Name: " << name[i] << endl;
                cout << "Address: " << address[i] << endl;
                cout << "Date of Birth: " << dob[i] << endl;
                cout << "Maritual Status: " << marstatus[i] << endl
                     << endl;

                cout << "** WORK DETAILS **" << endl
                     << endl;

                cout << "Id: " << id[i] << endl;
                cout << "Date of Joing: " << doj[i] << endl;
                cout << "Work Department: " << workd[i] << endl;
                cout << "Work Location: " << workl[i] << endl;
                cout << "CTC: " << ctc[i] << endl;
                cout << "Social Insurance: " << socialins[i] << endl
                     << endl;

                cout << "** CONTACT DETAILS **" << endl
                     << endl;
                cout << "Mobile NO: " << mobile_no[i] << endl;
                cout << "Email Id: " << email[i] << endl;
                cout << "\nEnter new data: " << endl
                     << endl;
                cout << "** PERSONAL DETAILS **" << endl
                     << endl;

                cout << "Enter Name: " << endl;

                cin >> name[i];

                cout << "Enter Address: " << endl;

                cin >> address[i];

                cout << "Enter Date of Birth: " << endl;

                cin >> dob[i];

                cout << "Is Employee Married?: " << endl;

                cin >> marstatus[i];

                cout << "** WORK DETAILS **" << endl
                     << endl;

                cout << "Enter Id: " << endl;

                cin >> id[i];

                cout << "Enter Date of Joing: " << endl;

                cin >> doj[i];

                cout << "Work Department: " << endl;

                cin >> workd[i];

                cout << "Enter Work Location: " << endl;

                cin >> workl[i];

                cout << "Enter CTC: " << endl;

                cin >> ctc[i];

                cout << "Enter Social Insurance Id: " << endl;

                cin >> socialins[i];

                cout << "** CONTACT DETAILS **" << endl
                     << endl;

                cout << "Enter Mobile NO: " << endl;

                cin >> mobile_no[i];

                cout << "Enter Email: " << endl;

                cin >> email[i];
            }
        }
    }
}

void Delete()
{

    if (total == 0)
    {
        cout << "No data is entered yet" << endl;
    }

    else
    {
        int a;

        cout << "Are you Sure to Delete Data?" << endl;
        cout << "Press 1 to delete all record" << endl;

        cin >> a;

        if (a == 1)

        {

            total = 0;

            cout << "All record is deleted..!!" << endl;
        }
        else
        {
            cout << "Please Press 1 to Delete All Record" << endl;
        }
    }
}

int main()

{

    int value, sample;

    cout << "ENTER 1: To Proceed.." << endl;
    cin >> sample;

    while (sample < 2) // always in Loop

    {
        cout << ">>>>>>>>  EMPLOYEE RECORD MANAGEMENT SYSTEM  <<<<<<<<" << endl;

        cout << "\nPRESS 1: To Enter data" << endl;

        cout << "-------------------------" << endl;

        cout << "PRESSS 2: To Show data" << endl;
        cout << "-------------------------" << endl;

        cout << "PRESSS 3: To Search data" << endl;
        cout << "-------------------------" << endl;

        cout << "PRESSS 4: To Update data" << endl;
        cout << "-------------------------" << endl;

        cout << "PRESSS 5: To Delete data" << endl;
        cout << "-------------------------" << endl;

        cout << "PRESSS 6: To Quit" << endl;
        cout << "-------------------------" << endl;

        cin >> value;

        switch (value)

        {

        case 1:
            enter();
            break;

        case 2:
            show();
            break;

        case 3:
            search();
            break;

        case 4:
            update();
            break;

        case 5:
            Delete();
            break;

        case 6:
            exit(0);
            break;

        default:
            cout << "Invalid input" << endl;
            break;
        }
    }
}
				
			

Explanation:

In this project Functions play very important role.

Each functionality has a function call in switch statement on the user choice control transfers to a function.

When you execute the program, you get options to choose to what you want to do with your data such as Enter, search, update, show, delete.

As you choose options you it makes changes in it.
If you don’t want to make any changes then there is an option of ‘QUIT’ you can choose it.
The codes are very easy and understandable to even beginner who knows the basic concepts of C++.
The basic five features of this project make it user friendly, here is a brief overview of these five features:

Enter Data:This feature allows you to store general information records that includes the Employee’s ‘Personal Details’, ’Work Details’ & ‘Contact Details’.

Show data:It allows to show the Employee data we have stored. if there is no stored data it shows ‘No Data is Stored’.

Search Data:This feature allows you to search the added records by entering the Id of Employee.

Update Data:If you want to make any changes to the stored data then this option helps you to make any required changes in data

Delete Records:This feature is for deleting the added Employees’ information.

Output:

Find More Projects

Whack a Mole Game with HTML CSS And JavaScript Introduction Hello friends, you all are welcome to today’s beautiful and unique project. Today …

3D Car Driving Game Using Html CSS And JavaScript Introduction Hello friends, welcome to today’s new blog post. Today we have created …

Dice Rolling Game Using HTML CSS And JavaScript Introduction Hey coders, welcome to another new blog. In this article we’ll build a …

Crossey Road Game Clone Using HTML CSS And JavaScript Introduction This is our HTML code which sets up the basic structure of …

Memory Card Game Using HTML CSS And JavaScript Introduction Hello coders, welcome to another new blog. Today in this article we’ll learn …

sudoku game using html CSS and JavaScript Introduction Hello friends, you all are welcome to today’s beautiful project. Today we have made …