Employee Management System
Employee Management System
SUBMITTED TO:
SUBMITTED BY:
Hadia Qasim(23-CS-99)
#include<iostream>
#include<conio.h>
#include<cstdlib>
#include<cstring>
#include<cstdio>
#include<windows.h>
#include<unistd.h>
using namespace std;
class employee{
private:
// Variables for employee details
char name[30];
char id[5];
char designation[10];
int age;
int ctc;
int experience;
// Utility functions
void waitForEnter(void){
cout<<"\n\n\n Press enter to go back \n\n";
cin.get();
cin.get();
}
char ch;
cout<<"\nEnter 'y' to save above information\n";
cin>>ch;
if(ch=='y'){
FILE *file;
file= fopen("data.txt","a");
fprintf(file, "%s %s %s %d %d %d \n", name, id, designation, age, ctc, experience );
fclose(file);
cout<<"\nNew Employee has been added to database\n";
}
else
addNewEmployee();
waitForEnter();
}
public:
// Function to serve as end point
void options(void){ //menu
int login(); //login declaration
login();//login screen
while(true){
system("cls");
}
}
};
int main(){
// Call the options function
employee e;
e.options();
return 0;
}
system("PAUSE");
system("CLS");
}else{
cout << "\nAccess Aborted...\n";
login();
}
}
OUTPUT :
1 : To Add Employe
4: To Delete Employee
Introduction:
The Employee Management System (EMS) is designed to streamline employee data management
within an organization. This system allows administrators to perform various tasks such as adding
new employee records, editing existing employee details, deleting employee records, and viewing
employee information.
The system is implemented using C++ programming language and utilizes file handling for data
storage. It provides a menu-driven interface for easy navigation and interaction.
Methodology:
Class Structure:
The EMS is implemented using a single class employee, which encapsulates all the
necessary functionalities and data members.
Data Members:
Member Functions:
Main Function:
The main() function initializes an object of the employee class and calls the options()
function to start the EMS.
Login Function:
The login() function is implemented to provide access control to the system. Users are
prompted to enter a password, and access is granted upon successful authentication.
Working:
Login Procedure:
• Upon running the program, users are prompted to enter a password.
• If the correct password is entered, access is granted, and the main menu is displayed.
• If the password is incorrect, access is denied, and users are prompted to retry.
Main Menu:
• Users are presented with a menu displaying various options such as viewing
employee lists, adding, editing, or deleting employee records, and exiting the
system.
• Users can input their choice, and the corresponding functionality is executed.
Functionality:
• Viewing Employee Lists: Displays a list of all employees with their basic
information.
• Viewing Employee Details: Allows users to view detailed information about a
specific employee by entering their ID.
• Editing Existing Employee Details: Enables users to modify the designation and
CTC of an existing employee by entering their ID.
• Adding New Employee Details: Allows users to input details of a new employee and
adds them to the system.
• Deleting Employee Details: Enables users to remove an existing employee record
from the system by entering their ID.
Data Storage: