Add to Favorites    Make Home Page 228388 Online  
 Language Categories  
 Our Services  

Home » C++ Home » Beginners / Lab Assignments Home » Project - Employees Management System

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title Project - Employees Management System
Author Sahil Seth
Author Email info_seth [at] sify.com
Description This projects gives understanding of how can we play with arrays like deleteing sorting and seraching.
Category C++ » Beginners / Lab Assignments
Hits 384913
Code Select and Copy the Code
// This Program is developed by sahil seth // if you have any problem please consult with me info_seth@sify.com //thanks #include<iostream.h> #include<string.h> #include<iomanip.h> #include<dos.h> #include<conio.h> #include<stdio.h> #define max 20 struct employee { char name[20]; long int code; char designation[20]; int exp; int age; }; int num; employee emp[max],tempemp[max],sortemp[max],sortemp1[max]; void main() { clrscr(); void build(); void list(); void insert(); void deletes(); void edit(); void search(); void sort(); char option; void menu(); menu(); while((option=cin.get())!='q') { switch(option) { case 'b': build(); break; case 'l': list(); break; case 'i': insert(); break; case 'd': deletes(); break; case 'e': edit(); break; case 's': search(); break; case 'n': sort(); break; } menu(); } } void menu() { clrscr(); highvideo(); cout<<" "; cprintf("*****WelCome To Employee Data Centre***** "); normvideo(); cout<<endl; cout<<" "; cout<<"Press b---->Built The Employee Table "; cout<<" "; cout<<"Press l---->List The Employee Table "; cout<<" "; cout<<"Press i---->Insert New Entry "; cout<<" "; cout<<"Press d---->Delete An Entry "; cout<<" "; cout<<"Press e---->Edit An Entry "; cout<<" "; cout<<"Press s---->Search Arecord "; cout<<" "; cout<<"Press n---->Sort The Table "; cout<<" "; cout<<"Press q---------->QUIT "; cout<<" "; cout<<"Option Please ----->"; } void build() { clrscr(); highvideo(); cprintf("Build The Table "); cout<<endl; normvideo(); cout<<"maximum number of entries ----- > 20"<<endl; cout<<"how many do you want ----->"; cin>>num; cout<<"Enter The Following Items "; for(int i=0;i<=num-1;i++) { cout<<" Name "; cin>>emp[i].name; cout<<"Code "; cin>>emp[i].code; cout<<"Designation "; cin>>emp[i].designation; cout<<"Years of Experience "; cin>>emp[i].exp; cout<<"Age "; cin>>emp[i].age; } cout<<"going to main menu"; delay(500); } void list() { clrscr(); highvideo(); cprintf(" ********List The Table********"); cout<<endl; normvideo(); cout<<" Name Code Designation Years(EXP) Age "; cout<<" ------------------------------------------------------ "; for(int i=0;i<=num-1;i++) { cout<<setw(13)<<emp[i].name; cout<<setw(6)<<emp[i].code; cout<<setw(15)<<emp[i].designation; cout<<setw(10)<<emp[i].exp; cout<<setw(15)<<emp[i].age; cout<<endl; } cout<<"going to main menu"; getch(); } void insert() { clrscr(); int i=num; num+=1; highvideo(); cprintf("Insert New Record "); cout<<endl; normvideo(); cout<<"Enter The Following Items "; cout<<"Name "; cin>>emp[i].name; cout<<"Code "; cin>>emp[i].code; cout<<"Designation "; cin>>emp[i].designation; cout<<"Years of Experience "; cin>>emp[i].exp; cout<<"Age "; cin>>emp[i].age; cout<<endl<<endl; cout<<"going to main menu"; delay(500); } void deletes() { clrscr(); highvideo(); int code; int check; cprintf("Delete An Entry "); normvideo(); cout<<endl; cout<<"Enter An JobCode To Delete That Entry "; cin>>code; int i; for(i=0;i<=num-1;i++) { if(emp[i].code==code) { check=i; } } for(i=0;i<=num-1;i++) { if(i==check) { continue; } else { if(i>check) { tempemp[i-1]=emp[i]; } else { tempemp[i]=emp[i]; } } } num--; for(i=0;i<=num-1;i++) { emp[i]=tempemp[i]; } } void edit() { clrscr(); int jobcode; highvideo(); cprintf(" Edit An Entry "); cout<<endl; cout<<endl; int i; void editmenu(); void editname(int); void editcode(int); void editdes(int); void editexp(int); void editage(int); char option; normvideo(); cout<<"Enter An jobcode To Edit An Entry---- "; cin>>jobcode; editmenu(); for(i=0;i<=num-1;i++) { if(emp[i].code==jobcode) { while((option=cin.get())!='q') { switch(option) { case 'n': editname(i); break; case 'c': editcode(i); break; case 'd': editdes(i); break; case 'e': editexp(i); break; case 'a': editage(i); break; } editmenu(); } } } } void editmenu() { clrscr(); cout<<" What Do You Want To edit "; cout<<" n--------->Name "; cout<<" c--------->Code "; cout<<" d--------->Designation "; cout<<" e--------->Experience "; cout<<" a--------->Age "; cout<<" q----->QUIT "; cout<<" Options Please ---->>> "; } void editname(int i) { cout<<"Enter New Name-----> "; cin>>emp[i].name; } void editcode(int i) { cout<<"Enter New Job Code-----> "; cin>>emp[i].code; } void editdes(int i) { cout<<"enter new designation-----> "; cin>>emp[i].designation; } void editexp(int i) { cout<<"Enter new Years of Experience "; cin>>emp[i].exp; } void editage(int i) { cout<<"Enter new Age "; cin>>emp[i].age; } void search() { clrscr(); highvideo(); cprintf("Welcome To Search Of Employee Database "); normvideo(); cout<<endl; cout<<endl; int jobcode; cout<<"You Can Search Only By Jobcode Of An Employee "; cout<<"Enter Code Of An Employee "; cin>>jobcode; for(int i=0;i<=num-1;i++) { if(emp[i].code==jobcode) { cout<<" Name Code Designation Years(EXP) Age "; cout<<" ------------------------------------------------------ "; cout<<setw(13)<<emp[i].name; cout<<setw(6)<<emp[i].code; cout<<setw(15)<<emp[i].designation; cout<<setw(10)<<emp[i].exp; cout<<setw(15)<<emp[i].age; cout<<endl; } } cout<<"going to main menu"; getch(); } void sort() { clrscr(); highvideo(); cprintf("Sort The Databse By JobCode "); normvideo(); void sortmenu(); void sortname(); void sortcode(); void sortdes(); void sortexp(); char option; void sortage(); cout<<endl; cout<<endl; sortmenu(); while((option=cin.get())!='q') { switch(option) { case 'n': sortname(); break; case 'c': sortcode(); break; case 'd': sortdes(); break; case 'e': sortexp(); break; case 'a': sortage(); break; } sortmenu(); } } void sortmenu() { clrscr(); cout<<" What Do You Want To edit "; cout<<" n--------->Name "; cout<<" c--------->Code "; cout<<" d--------->Designation "; cout<<" e--------->Experience "; cout<<" a--------->Age "; cout<<" q----->QUIT "; cout<<" Options Please ---->>> "; } void sortname() { clrscr(); int i,j; struct employee temp[max]; for(i=0;i<=num-1;i++) { sortemp1[i]=emp[i]; } for(i=0;i<=num-1;i++) { for(j=0;j<=num-1;j++) { if(strcmp(sortemp1[i].name,sortemp1[j].name)<=0) { temp[i]=sortemp1[i]; sortemp1[i]=sortemp1[j]; sortemp1[j]=temp[i]; } } } for( i=0;i<=num-1;i++) { cout<<" Name Code Designation Years(EXP) Age "; cout<<" ------------------------------------------------------ "; for( i=0;i<=num-1;i++) { cout<<setw(13)<<sortemp1[i].name; cout<<setw(6)<<sortemp1[i].code; cout<<setw(15)<<sortemp1[i].designation; cout<<setw(10)<<sortemp1[i].exp; cout<<setw(15)<<sortemp1[i].age; cout<<endl; } cout<<"Press Any Key To Go Back"; getch(); } } void sortcode() { clrscr(); int i,j; struct employee temp[max]; for(i=0;i<=num-1;i++) { sortemp1[i]=emp[i]; } for(i=0;i<=num-1;i++) { for(j=0;j<=num-1;j++) { if(sortemp1[i].code<sortemp1[j].code) { temp[i]=sortemp1[i]; sortemp1[i]=sortemp1[j]; sortemp1[j]=temp[i]; } } } for( i=0;i<=num-1;i++) { cout<<" Name Code Designation Years(EXP) Age "; cout<<" ------------------------------------------------------ "; for( i=0;i<=num-1;i++) { cout<<setw(13)<<sortemp1[i].name; cout<<setw(6)<<sortemp1[i].code; cout<<setw(15)<<sortemp1[i].designation; cout<<setw(10)<<sortemp1[i].exp; cout<<setw(15)<<sortemp1[i].age; cout<<endl; } cout<<"Press Any Key To Go Back"; getch(); } } void sortdes() { clrscr(); int i,j; struct employee temp[max]; for(i=0;i<=num-1;i++) { sortemp1[i]=emp[i]; } for(i=0;i<=num-1;i++) { for(j=0;j<=num-1;j++) { if(strcmp(sortemp1[i].designation,sortemp1[j].designation)<=0) { temp[i]=sortemp1[i]; sortemp1[i]=sortemp1[j]; sortemp1[j]=temp[i]; } } } for( i=0;i<=num-1;i++) { cout<<" Name Code Designation Years(EXP) Age "; cout<<" ------------------------------------------------------ "; for( i=0;i<=num-1;i++) { cout<<setw(13)<<sortemp1[i].name; cout<<setw(6)<<sortemp1[i].code; cout<<setw(15)<<sortemp1[i].designation; cout<<setw(10)<<sortemp1[i].exp; cout<<setw(15)<<sortemp1[i].age; cout<<endl; } cout<<"Press Any Key To Go Back"; getch(); } } void sortage() { clrscr(); int i,j; struct employee temp[max]; for(i=0;i<=num-1;i++) { sortemp1[i]=emp[i]; } for(i=0;i<=num-1;i++) { for(j=0;j<=num-1;j++) { if(sortemp1[i].age<sortemp1[j].age) { temp[i]=sortemp1[i]; sortemp1[i]=sortemp1[j]; sortemp1[j]=temp[i]; } } } for( i=0;i<=num-1;i++) { cout<<" Name Code Designation Years(EXP) Age "; cout<<" ------------------------------------------------------ "; for( i=0;i<=num-1;i++) { cout<<setw(13)<<sortemp1[i].name; cout<<setw(6)<<sortemp1[i].code; cout<<setw(15)<<sortemp1[i].designation; cout<<setw(10)<<sortemp1[i].exp; cout<<setw(15)<<sortemp1[i].age; cout<<endl; } cout<<"Press Any Key To Go Back"; getch(); } } void sortexp() { clrscr(); int i,j; struct employee temp[max]; for(i=0;i<=num-1;i++) { sortemp1[i]=emp[i]; } for(i=0;i<=num-1;i++) { for(j=0;j<=num-1;j++) { if(sortemp1[i].exp<sortemp1[j].exp) { temp[i]=sortemp1[i]; sortemp1[i]=sortemp1[j]; sortemp1[j]=temp[i]; } } } for( i=0;i<=num-1;i++) { cout<<" Name Code Designation Years(EXP) Age "; cout<<" ------------------------------------------------------ "; for( i=0;i<=num-1;i++) { cout<<setw(13)<<sortemp1[i].name; cout<<setw(6)<<sortemp1[i].code; cout<<setw(15)<<sortemp1[i].designation; cout<<setw(10)<<sortemp1[i].exp; cout<<setw(15)<<sortemp1[i].age; cout<<endl; } cout<<"Press Any Key To Go Back"; getch(); } }

Related Source Codes

Script Name Author
Moving ball screen saver karlmarx
The Classic Game of Snake & Ladder Lakshmi Narayana .A
Railway seat reservation question which comes in sapient VyomWorld
To calculate percentile Ravi Mathur
Send to folder ANIMESH SAHU
Analog clock and calendar Nazia & Rida
HIGH/LOW GAME MOLLY ARORA
Data structure (stack Implimentation) Swapnil B Adsure
Memory Game AnirudhSanyal
Easy Calc Anirudh Sanyal
GK Quiz Anirudh Sanyal
Hangman Game Manish Jain
Snakeman Manish Jain
Full month Calendar Nigi
Cursor shapes nigi

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=482


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review