SlideShare a Scribd company logo
Computer science project work
This program is very useful in real life situation for
providing instant information of Employees working
under any company, department. It also stores the
information about employees monthly salary, employee
id and designation.
In this c++ program we can modify , add, delete, recall
and list the records.
Being OOP concept available, we can add or remove
function anytime we need and even add classes and
derived classes for further improvement of the program
Without recording.




                            2
SERIAL          CONTENTS      PAGE NUMBER
NUMBER

1.       CERTIFICATE.        4


2.       EMPLOYEE DATABASE   5 – 19
         MANAGEMENT
         SYSTEM PROGRAME.
3.       OUTPUT OF THE       20
         PROGRAME.

4.       BIBLIOGRAPHY.       21


5.       THANKS PAGE.        22




                         3
This is to certify that Rahul Tripathi and Utkarsh Srivastva
of class XII has successfully completed this computer
project on the topic “Employee Database Management
System” prescribed by Mr. A.K Shukla Sir, during
academic session 2012-2013 as per the guidelines issues
by Central Board of Secondary Education.


Mr. A.K Shukla                          External Examiner
(P.G.T, computer)




                             4
#include<fstream.h>
#include<dos.h>
#include<conio.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<iomanip.h>
#include<graphics.h>


    class group
    {
    private:
        struct person
{
     char flag;
     char empcode[5];
     char name[40];
     int age;
     float sal;
     int day;
     int month;
     int year;
     }p;
     fstream file;
     public:
group();


void addrec();
void listrec();
void modirec();
void delrec();
void recallrec();
void packrec();
void exit();
};




void main()


{
char choice,v;
group g;
do
{
clrscr();
struct dosdate_t d;
_dos_getdate(&d);
//   p.day=d.day;
    //   p.month=d.month;
    //   p.year=d.year;
    //   _dos_getdate(&d);
gotoxy(12,5);
textcolor(6);
    cprintf("Todays date:");
    printf("%d",d.day);
    cout<<"/";
    printf("%d",d.month);
    cout<<"/";
    cout<<d.year;
    gotoxy(12,9);
cout<<"Srknec.corporation pvt.ltd";
gotoxy(12,12);
cout<<"1.Add record";
gotoxy(12,15);
cout<<"2.List Record";
gotoxy(12,17);
cout<<"3.Modify record";
gotoxy(12,19);
cout<<"4.Delete record";
gotoxy(12,21);
cout<<"5.Recall record";
gotoxy(12,23);
cout<<"6.Pack record";
gotoxy(12,25);
cout<<"0.Exit";
gotoxy(12,28);
cout<<"Your choice"<<" ";
cin>>choice;
   clrscr();


switch(choice)
{
case '1':
g.addrec();
break;
case'2':
g.listrec();
break;


case'3':
g.modirec();
break;


case'4':
g.delrec();
break;


case'5':
g.recallrec();
break;


case'6':
g.packrec();
break;


case'0':
g.exit();
exit(1);


}
     }
     while(choice!=0);
}
void group::group()
{
    file.open("Emp.dat",ios::binary|ios::in|ios::out);
    p.flag=' ';
    if(!file)
    {
    cout<<endl<<"Unable to open file";
    exit();
    }


}
    void group::addrec()
{
    char ch;
    file.seekp(0L,ios::end);
struct dosdate_t d;
_dos_getdate(&d);
p.day=d.day;
        p.month=d.month;
        p.year=d.year;


       cout<<"Make shure that no employee has the
same code"<<endl;
        do
        {
     cout<<endl<<"Enter employee code, name, age &
salary
:"<<endl<<endl;
    cout<<"OR"<<endl<<endl;
     cout<<"To return to the Main menu press'm' key
else press'a':";
    cin>>ch;
    if(ch=='m'||ch=='M')
    {
        main();
}
    cin>>p.empcode>>p.name>>p.age>>p.sal;
    p.flag=' ';
    file.write((char*)&p,sizeof(p));
    cout<<"Add another record ?(y/n) :";
    cin>>ch;
    }
    while(ch=='y'||ch=='Y');
         }
         void group::listrec()
    {
        int j=0,a;
        file.seekg(0L,ios::beg);


   cout<<"List of records present are as
under>>>"<<endl<<endl;
cout<<"    "<<"|CODE|"<<"
"<<"|NAME|"<<"
"<<"|AGE|"<<" "<<"|SALARY|"<<" "<<"|DATED|"<<endl;
        //Donot touch Above Line Any Way it is set to
give Some Nice Look
           while(file.read((char*)&p,sizeof(p)))
      {
           if(p.flag!='*')


cout<<endl<<"Record#"<<"
"<<j++<<setw(6)<<p.empcode<<setw(20)<<p.name<<set
w(4)<<p.age<<setw(9)<<p.sal<<"
"<<p.day<<"/"<<p.month<<"/"<<p.year<<endl;
}
file.clear();


if(j==0)
{
gotoxy(10,10);
cout<<"No record exit";
gotoxy(10,11);
cout<<"Press any key...";
getch();
}
else
{
cout<<endl<<"Press any key...";
getch();
}
}
void group::modirec()
{
char code[5];
int count=0;
long int pos;
cout<<"Enter employee code whose record is to be
modified :";
cin>>code;
file.seekg(0L,ios::beg);
while(file.read((char*)&p,sizeof(p)))
{
if(strcmp(p.empcode,code)==0)
{
cout<<endl<<"Enter new record "<<endl;
 cout<<endl<<"Enter employee name,age & salary
:"<<endl;
cin>>p.name>>p.age>>p.sal;
struct dosdate_t d;
_dos_getdate(&d);
p.day=d.day;
p.month=d.month;
p.year=d.year;
p.flag=' ';
pos=count*sizeof(p);
file.seekp(pos,ios::beg);
file.write((char*)&p,sizeof(p));
return;
}
count++;
}
cout<<endl<<"No employee in file with code= "<<code;
getch();
file.clear();
}
void group::delrec()
     {
     char code[5];
     long int pos;
     int count=0;
cout<<"Enter employee code to be deleted :";
    cin>>code;
    file.seekg(0L,ios::beg);
    while(file.read((char*)&p,sizeof(p)))
    {
    if (strcmp(p.empcode,code)==0)
    {
    p.flag='*';
    pos=count*sizeof(p);
    file.seekp(pos,ios::beg);
    file.write((char*)&p,sizeof(p));
    return;
    }
    count++;
    }
    cout<<endl<<"No employee in file with
code="<<code;
cout<<endl<<"Press any key...";
getch();
file.clear();
}
void group::recallrec()
{
     char code[5];
     long int pos;
     int count=0;


     cout<<"Enter employee code to be recalled :";
     cin>>code;


     file.seekg(0L,ios::beg);


     while(file.read((char*)&p,sizeof(p)))
     {
if(strcmp(p.empcode,code)==0)
         {
         p.flag=' ';
         pos=count*sizeof(p);
         file.seekp(pos,ios::beg);
         file.write((char*)&p,sizeof(p));
         return;
         }


         count++;
    }
    cout<<endl<<"No employee in the file with
code="<<code;
    cout<<endl<<"Press any key...";
    getch();
    file.clear();
          }
void group::packrec()
         {
          ofstream outfile;
    outfile.open("TEMP",ios::out);
    file.seekg(0,ios::beg);
    while(file.read((char*)&p,sizeof(p)))
    {
     if(p.flag!='*')
     outfile.write((char*)&p,sizeof(p));
     }
     outfile.close();
     file.close();
     remove("Emp.DAT");
     rename("TEMP","EMP.DAT");


file.open("EMP.DAT",ios::binary|ios::in|ios::out|ios::nocr
eate);
gotoxy(10,10);
cout<<"Marked records to be deleted are all removed";
gotoxy(10,11);
cout<<"press any key....";
getch();
}
void group::exit()
{
file.close();
}
Todays date : 2/01/2013
Srknec.corporation pvt.ltd
  1. Add record
  2. List record
  3. Modify record
  4. Delete record
  5. Recall record
  6. Pack record
  0. Exit your choice




                             20
To make this project we have taken source from a book
“Computer Science With C++” written by Sumita Arora
and “let us c++” written by Yashwanth Kanethkar.
And taken help of our computer teacher Mr. A.K Shukla
sir.




                          21
We would like to thank our computer sir Mr. A.K Shukla,
who provided us this opportunity to make a project on
“Employee Database Management System” which really
helped us to understand the concepts of C++ computer
programming.




                           22
Computer science project work

More Related Content

What's hot (20)

DOCX
Banking Management System Project documentation
Chaudhry Sajid
 
DOCX
12th CBSE Computer Science Project
Ashwin Francis
 
PDF
project report on Gas booking system in c++
vikram mahendra
 
PDF
Online Examination System Project report
SARASWATENDRA SINGH
 
DOCX
C++ project on police station software
dharmenderlodhi021
 
DOCX
Practical File of C Language
RAJWANT KAUR
 
DOC
STUDENT REPORT CARD GENERATE SYSTEM
vikram mahendra
 
DOCX
C.S. project report on railway ticket reservation
Virat Prasad
 
PDF
Documentation project of college management [1]
Priyaranjan Verma
 
PPT
Student management system
Amit Gandhi
 
PPT
C by balaguruswami - e.balagurusamy
Srichandan Sobhanayak
 
DOC
programming in C++ report
vikram mahendra
 
PPTX
Mobile based attandance system
Abhishek Jha
 
DOCX
Sims(Student Information management System)
saiyadsanobar
 
DOCX
Library Management System Project Report
Abu Kaisar
 
DOCX
Hotel Management system in C++
Prince Kumar
 
PDF
15.project attendence managemnt system
Haseeb Nasir
 
DOCX
Online attendance management system
Deepankar Sandhibigraha
 
PPTX
Library Management System Project in C
codewithc
 
DOC
Clothing Store and Management System
Ashwini0951
 
Banking Management System Project documentation
Chaudhry Sajid
 
12th CBSE Computer Science Project
Ashwin Francis
 
project report on Gas booking system in c++
vikram mahendra
 
Online Examination System Project report
SARASWATENDRA SINGH
 
C++ project on police station software
dharmenderlodhi021
 
Practical File of C Language
RAJWANT KAUR
 
STUDENT REPORT CARD GENERATE SYSTEM
vikram mahendra
 
C.S. project report on railway ticket reservation
Virat Prasad
 
Documentation project of college management [1]
Priyaranjan Verma
 
Student management system
Amit Gandhi
 
C by balaguruswami - e.balagurusamy
Srichandan Sobhanayak
 
programming in C++ report
vikram mahendra
 
Mobile based attandance system
Abhishek Jha
 
Sims(Student Information management System)
saiyadsanobar
 
Library Management System Project Report
Abu Kaisar
 
Hotel Management system in C++
Prince Kumar
 
15.project attendence managemnt system
Haseeb Nasir
 
Online attendance management system
Deepankar Sandhibigraha
 
Library Management System Project in C
codewithc
 
Clothing Store and Management System
Ashwini0951
 

Viewers also liked (20)

PDF
Computer Science Investigatory Project Class 12
Self-employed
 
DOC
Project report
meenalpandey
 
PDF
MOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECT
Sindhu Ashok
 
DOCX
c++ report file for theatre management project
Rajesh Gangireddy
 
PDF
School Management (c++)
Nirdhishwar Nirdhi
 
TXT
c++ project on restaurant billing
Swakriti Rathore
 
PPTX
C++ Project
srinu2792
 
PDF
High performance web programming with C++14
Matthieu Garrigues
 
PDF
Reema Agarwal , BCA Third Year
Dezyneecole
 
PDF
Ravi Prakash Yadav , BCA Third Year
Dezyneecole
 
PDF
Binary studio academy 2013 c++ group (andrey and max)
Binary Studio
 
PDF
Rakesh Bijawat , BCA Third Year
Dezyneecole
 
DOCX
Railway reservation(c++ project)
Debashis Rath
 
PPT
Bank Management System
Vinoth Ratnam Sudalaimuthu
 
DOCX
documentation on bank management system
Unsa Jawaid
 
DOCX
Acknowledgement
Utkarsh0825
 
DOCX
Employee Management System Project Propsal
Syed Junaid
 
DOC
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )
Vidhi Kishor
 
PDF
Computer science Project for class 11th and 12th(library management system)
lokesh meena
 
DOCX
Online railway reservation system
PIYUSH Dubey
 
Computer Science Investigatory Project Class 12
Self-employed
 
Project report
meenalpandey
 
MOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECT
Sindhu Ashok
 
c++ report file for theatre management project
Rajesh Gangireddy
 
School Management (c++)
Nirdhishwar Nirdhi
 
c++ project on restaurant billing
Swakriti Rathore
 
C++ Project
srinu2792
 
High performance web programming with C++14
Matthieu Garrigues
 
Reema Agarwal , BCA Third Year
Dezyneecole
 
Ravi Prakash Yadav , BCA Third Year
Dezyneecole
 
Binary studio academy 2013 c++ group (andrey and max)
Binary Studio
 
Rakesh Bijawat , BCA Third Year
Dezyneecole
 
Railway reservation(c++ project)
Debashis Rath
 
Bank Management System
Vinoth Ratnam Sudalaimuthu
 
documentation on bank management system
Unsa Jawaid
 
Acknowledgement
Utkarsh0825
 
Employee Management System Project Propsal
Syed Junaid
 
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )
Vidhi Kishor
 
Computer science Project for class 11th and 12th(library management system)
lokesh meena
 
Online railway reservation system
PIYUSH Dubey
 
Ad

Similar to Computer science project work (20)

DOCX
computer project code ''payroll'' (based on datafile handling)
Nitish Yadav
 
PPTX
Employee management system
Deepák Soni
 
DOCX
Classes(or Libraries)#include #include #include #include.docx
brownliecarmella
 
RTF
project3
Russell Rawls
 
PDF
The purpose of this C++ programming project is to allow the student .pdf
Rahul04August
 
DOC
SALARY MANAGEMENT SYSTEM IN C++
vikram mahendra
 
PDF
I am trying to change this code from STRUCTS to CLASSES, the members.pdf
petercoiffeur18
 
DOCX
Student DATABASE MANAGeMEnT SysTEm
home
 
PDF
Employee Management System in C++
Jayant Gope
 
PDF
Open a new project in Visual Studio Community and name it in the form.pdf
lonkarhrishikesh
 
DOCX
Sunil
sunilkumawat63
 
DOCX
lab 6.docxThe emphasis in this lab is the use of struc.docx
smile790243
 
PPTX
OOPS 22-23 (1).pptx
SushmaGavaraskar
 
PDF
#include iostream #include fstream #include string #incl.pdf
aptexx
 
DOCX
Write a task that will perform some of the functions performed by a s.docx
ajoy21
 
PDF
Open a new project in Visual Studio Community and name it in the form.pdf
Nathan2rSPeakes
 
PDF
Having issues with passing my values through different functions aft.pdf
rajkumarm401
 
PDF
in C++ Design a class named Employee The class should keep .pdf
adithyaups
 
DOCX
Cs pritical file
Mitul Patel
 
PDF
To write a program that implements the following C++ concepts 1. Dat.pdf
SANDEEPARIHANT
 
computer project code ''payroll'' (based on datafile handling)
Nitish Yadav
 
Employee management system
Deepák Soni
 
Classes(or Libraries)#include #include #include #include.docx
brownliecarmella
 
project3
Russell Rawls
 
The purpose of this C++ programming project is to allow the student .pdf
Rahul04August
 
SALARY MANAGEMENT SYSTEM IN C++
vikram mahendra
 
I am trying to change this code from STRUCTS to CLASSES, the members.pdf
petercoiffeur18
 
Student DATABASE MANAGeMEnT SysTEm
home
 
Employee Management System in C++
Jayant Gope
 
Open a new project in Visual Studio Community and name it in the form.pdf
lonkarhrishikesh
 
lab 6.docxThe emphasis in this lab is the use of struc.docx
smile790243
 
OOPS 22-23 (1).pptx
SushmaGavaraskar
 
#include iostream #include fstream #include string #incl.pdf
aptexx
 
Write a task that will perform some of the functions performed by a s.docx
ajoy21
 
Open a new project in Visual Studio Community and name it in the form.pdf
Nathan2rSPeakes
 
Having issues with passing my values through different functions aft.pdf
rajkumarm401
 
in C++ Design a class named Employee The class should keep .pdf
adithyaups
 
Cs pritical file
Mitul Patel
 
To write a program that implements the following C++ concepts 1. Dat.pdf
SANDEEPARIHANT
 
Ad

Computer science project work

  • 2. This program is very useful in real life situation for providing instant information of Employees working under any company, department. It also stores the information about employees monthly salary, employee id and designation. In this c++ program we can modify , add, delete, recall and list the records. Being OOP concept available, we can add or remove function anytime we need and even add classes and derived classes for further improvement of the program Without recording. 2
  • 3. SERIAL CONTENTS PAGE NUMBER NUMBER 1. CERTIFICATE. 4 2. EMPLOYEE DATABASE 5 – 19 MANAGEMENT SYSTEM PROGRAME. 3. OUTPUT OF THE 20 PROGRAME. 4. BIBLIOGRAPHY. 21 5. THANKS PAGE. 22 3
  • 4. This is to certify that Rahul Tripathi and Utkarsh Srivastva of class XII has successfully completed this computer project on the topic “Employee Database Management System” prescribed by Mr. A.K Shukla Sir, during academic session 2012-2013 as per the guidelines issues by Central Board of Secondary Education. Mr. A.K Shukla External Examiner (P.G.T, computer) 4
  • 6. { char flag; char empcode[5]; char name[40]; int age; float sal; int day; int month; int year; }p; fstream file; public: group(); void addrec(); void listrec(); void modirec();
  • 7. void delrec(); void recallrec(); void packrec(); void exit(); }; void main() { char choice,v; group g; do { clrscr(); struct dosdate_t d; _dos_getdate(&d);
  • 8. // p.day=d.day; // p.month=d.month; // p.year=d.year; // _dos_getdate(&d); gotoxy(12,5); textcolor(6); cprintf("Todays date:"); printf("%d",d.day); cout<<"/"; printf("%d",d.month); cout<<"/"; cout<<d.year; gotoxy(12,9); cout<<"Srknec.corporation pvt.ltd"; gotoxy(12,12); cout<<"1.Add record"; gotoxy(12,15);
  • 9. cout<<"2.List Record"; gotoxy(12,17); cout<<"3.Modify record"; gotoxy(12,19); cout<<"4.Delete record"; gotoxy(12,21); cout<<"5.Recall record"; gotoxy(12,23); cout<<"6.Pack record"; gotoxy(12,25); cout<<"0.Exit"; gotoxy(12,28); cout<<"Your choice"<<" "; cin>>choice; clrscr(); switch(choice)
  • 12. void group::group() { file.open("Emp.dat",ios::binary|ios::in|ios::out); p.flag=' '; if(!file) { cout<<endl<<"Unable to open file"; exit(); } } void group::addrec() { char ch; file.seekp(0L,ios::end); struct dosdate_t d; _dos_getdate(&d);
  • 13. p.day=d.day; p.month=d.month; p.year=d.year; cout<<"Make shure that no employee has the same code"<<endl; do { cout<<endl<<"Enter employee code, name, age & salary :"<<endl<<endl; cout<<"OR"<<endl<<endl; cout<<"To return to the Main menu press'm' key else press'a':"; cin>>ch; if(ch=='m'||ch=='M') { main();
  • 14. } cin>>p.empcode>>p.name>>p.age>>p.sal; p.flag=' '; file.write((char*)&p,sizeof(p)); cout<<"Add another record ?(y/n) :"; cin>>ch; } while(ch=='y'||ch=='Y'); } void group::listrec() { int j=0,a; file.seekg(0L,ios::beg); cout<<"List of records present are as under>>>"<<endl<<endl;
  • 15. cout<<" "<<"|CODE|"<<" "<<"|NAME|"<<" "<<"|AGE|"<<" "<<"|SALARY|"<<" "<<"|DATED|"<<endl; //Donot touch Above Line Any Way it is set to give Some Nice Look while(file.read((char*)&p,sizeof(p))) { if(p.flag!='*') cout<<endl<<"Record#"<<" "<<j++<<setw(6)<<p.empcode<<setw(20)<<p.name<<set w(4)<<p.age<<setw(9)<<p.sal<<" "<<p.day<<"/"<<p.month<<"/"<<p.year<<endl; } file.clear(); if(j==0) {
  • 16. gotoxy(10,10); cout<<"No record exit"; gotoxy(10,11); cout<<"Press any key..."; getch(); } else { cout<<endl<<"Press any key..."; getch(); } } void group::modirec() { char code[5]; int count=0; long int pos;
  • 17. cout<<"Enter employee code whose record is to be modified :"; cin>>code; file.seekg(0L,ios::beg); while(file.read((char*)&p,sizeof(p))) { if(strcmp(p.empcode,code)==0) { cout<<endl<<"Enter new record "<<endl; cout<<endl<<"Enter employee name,age & salary :"<<endl; cin>>p.name>>p.age>>p.sal; struct dosdate_t d; _dos_getdate(&d); p.day=d.day; p.month=d.month; p.year=d.year;
  • 18. p.flag=' '; pos=count*sizeof(p); file.seekp(pos,ios::beg); file.write((char*)&p,sizeof(p)); return; } count++; } cout<<endl<<"No employee in file with code= "<<code; getch(); file.clear(); } void group::delrec() { char code[5]; long int pos; int count=0;
  • 19. cout<<"Enter employee code to be deleted :"; cin>>code; file.seekg(0L,ios::beg); while(file.read((char*)&p,sizeof(p))) { if (strcmp(p.empcode,code)==0) { p.flag='*'; pos=count*sizeof(p); file.seekp(pos,ios::beg); file.write((char*)&p,sizeof(p)); return; } count++; } cout<<endl<<"No employee in file with code="<<code;
  • 20. cout<<endl<<"Press any key..."; getch(); file.clear(); } void group::recallrec() { char code[5]; long int pos; int count=0; cout<<"Enter employee code to be recalled :"; cin>>code; file.seekg(0L,ios::beg); while(file.read((char*)&p,sizeof(p))) {
  • 21. if(strcmp(p.empcode,code)==0) { p.flag=' '; pos=count*sizeof(p); file.seekp(pos,ios::beg); file.write((char*)&p,sizeof(p)); return; } count++; } cout<<endl<<"No employee in the file with code="<<code; cout<<endl<<"Press any key..."; getch(); file.clear(); }
  • 22. void group::packrec() { ofstream outfile; outfile.open("TEMP",ios::out); file.seekg(0,ios::beg); while(file.read((char*)&p,sizeof(p))) { if(p.flag!='*') outfile.write((char*)&p,sizeof(p)); } outfile.close(); file.close(); remove("Emp.DAT"); rename("TEMP","EMP.DAT"); file.open("EMP.DAT",ios::binary|ios::in|ios::out|ios::nocr eate);
  • 23. gotoxy(10,10); cout<<"Marked records to be deleted are all removed"; gotoxy(10,11); cout<<"press any key...."; getch(); } void group::exit() { file.close(); }
  • 24. Todays date : 2/01/2013 Srknec.corporation pvt.ltd 1. Add record 2. List record 3. Modify record 4. Delete record 5. Recall record 6. Pack record 0. Exit your choice 20
  • 25. To make this project we have taken source from a book “Computer Science With C++” written by Sumita Arora and “let us c++” written by Yashwanth Kanethkar. And taken help of our computer teacher Mr. A.K Shukla sir. 21
  • 26. We would like to thank our computer sir Mr. A.K Shukla, who provided us this opportunity to make a project on “Employee Database Management System” which really helped us to understand the concepts of C++ computer programming. 22