SlideShare a Scribd company logo
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

computer science with python project for class 12 cbse
computer science with python project for class 12 cbsecomputer science with python project for class 12 cbse
computer science with python project for class 12 cbse
manishjain598
 
computer science project
computer science projectcomputer science project
computer science project
Roshan Bastia
 
Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Self-employed
 
BANK MANAGEMENT SYSTEM report
BANK MANAGEMENT SYSTEM reportBANK MANAGEMENT SYSTEM report
BANK MANAGEMENT SYSTEM report
Nandana Priyanka Eluri
 
Banking Management System Project documentation
Banking Management System Project documentationBanking Management System Project documentation
Banking Management System Project documentation
Chaudhry Sajid
 
Library Management Python, MySQL
Library Management Python, MySQLLibrary Management Python, MySQL
Library Management Python, MySQL
Darshit Vaghasiya
 
C Programming Project
C Programming ProjectC Programming Project
C Programming Project
Vijayananda Mohire
 
Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)
lokesh meena
 
BLOOD DONATION SYSTEM IN C++
BLOOD DONATION SYSTEM IN C++BLOOD DONATION SYSTEM IN C++
BLOOD DONATION SYSTEM IN C++
vikram mahendra
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project12th CBSE Computer Science Project
12th CBSE Computer Science Project
Ashwin Francis
 
Student management system
Student management systemStudent management system
Student management system
Amit Gandhi
 
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
अयशकांत मिश्र
 
Student DATABASE MANAGeMEnT SysTEm
Student DATABASE MANAGeMEnT SysTEmStudent DATABASE MANAGeMEnT SysTEm
Student DATABASE MANAGeMEnT SysTEm
home
 
Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdf
HarshitSachdeva17
 
class 12th computer science project Employee Management System In Python
 class 12th computer science project Employee Management System In Python class 12th computer science project Employee Management System In Python
class 12th computer science project Employee Management System In Python
AbhishekKumarMorla
 
computer science project class 12th
computer science project class 12thcomputer science project class 12th
computer science project class 12th
Nitesh Kushwaha
 
Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game
Pritam Samanta
 
Report Card making BY Mitul Patel
Report Card making BY Mitul PatelReport Card making BY Mitul Patel
Report Card making BY Mitul Patel
Mitul Patel
 
Computer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school managementComputer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school management
RemaDeosiSundi
 
SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++
vikram mahendra
 

What's hot (20)

computer science with python project for class 12 cbse
computer science with python project for class 12 cbsecomputer science with python project for class 12 cbse
computer science with python project for class 12 cbse
 
computer science project
computer science projectcomputer science project
computer science project
 
Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12Computer Science Investigatory Project Class 12
Computer Science Investigatory Project Class 12
 
BANK MANAGEMENT SYSTEM report
BANK MANAGEMENT SYSTEM reportBANK MANAGEMENT SYSTEM report
BANK MANAGEMENT SYSTEM report
 
Banking Management System Project documentation
Banking Management System Project documentationBanking Management System Project documentation
Banking Management System Project documentation
 
Library Management Python, MySQL
Library Management Python, MySQLLibrary Management Python, MySQL
Library Management Python, MySQL
 
C Programming Project
C Programming ProjectC Programming Project
C Programming Project
 
Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)Computer science Project for class 11th and 12th(library management system)
Computer science Project for class 11th and 12th(library management system)
 
BLOOD DONATION SYSTEM IN C++
BLOOD DONATION SYSTEM IN C++BLOOD DONATION SYSTEM IN C++
BLOOD DONATION SYSTEM IN C++
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project12th CBSE Computer Science Project
12th CBSE Computer Science Project
 
Student management system
Student management systemStudent management system
Student management system
 
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
 
Student DATABASE MANAGeMEnT SysTEm
Student DATABASE MANAGeMEnT SysTEmStudent DATABASE MANAGeMEnT SysTEm
Student DATABASE MANAGeMEnT SysTEm
 
Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdf
 
class 12th computer science project Employee Management System In Python
 class 12th computer science project Employee Management System In Python class 12th computer science project Employee Management System In Python
class 12th computer science project Employee Management System In Python
 
computer science project class 12th
computer science project class 12thcomputer science project class 12th
computer science project class 12th
 
Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game Computer Project For Class XII Topic - The Snake Game
Computer Project For Class XII Topic - The Snake Game
 
Report Card making BY Mitul Patel
Report Card making BY Mitul PatelReport Card making BY Mitul Patel
Report Card making BY Mitul Patel
 
Computer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school managementComputer Project for class 12 CBSE on school management
Computer Project for class 12 CBSE on school management
 
SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++
 

Viewers also liked

Project report
Project reportProject report
Project report
meenalpandey
 
MOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECT
MOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECTMOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECT
MOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECT
Sindhu Ashok
 
c++ report file for theatre management project
c++ report file for theatre management projectc++ report file for theatre management project
c++ report file for theatre management project
Rajesh Gangireddy
 
School Management (c++)
School Management (c++) School Management (c++)
School Management (c++)
Nirdhishwar Nirdhi
 
C++ project on police station software
C++ project on police station softwareC++ project on police station software
C++ project on police station software
dharmenderlodhi021
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
Swakriti Rathore
 
Hotel Management system in C++
Hotel Management system in C++ Hotel Management system in C++
Hotel Management system in C++
Prince Kumar
 
C++ Project
C++ ProjectC++ Project
C++ Project
srinu2792
 
High performance web programming with C++14
High performance web programming with C++14High performance web programming with C++14
High performance web programming with C++14
Matthieu Garrigues
 
Reema Agarwal , BCA Third Year
Reema Agarwal , BCA Third YearReema Agarwal , BCA Third Year
Reema Agarwal , BCA Third Year
Dezyneecole
 
Ravi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearRavi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third Year
Dezyneecole
 
Binary studio academy 2013 c++ group (andrey and max)
Binary studio academy 2013 c++ group (andrey and max)Binary studio academy 2013 c++ group (andrey and max)
Binary studio academy 2013 c++ group (andrey and max)
Binary Studio
 
Rakesh Bijawat , BCA Third Year
Rakesh Bijawat , BCA Third YearRakesh Bijawat , BCA Third Year
Rakesh Bijawat , BCA Third Year
Dezyneecole
 
programming in C++ report
programming in C++ reportprogramming in C++ report
programming in C++ report
vikram mahendra
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)
Debashis Rath
 
documentation on bank management system
documentation on bank management systemdocumentation on bank management system
documentation on bank management systemUnsa Jawaid
 
Acknowledgement
AcknowledgementAcknowledgement
Acknowledgement
Utkarsh0825
 
Employee Management System Project Propsal
Employee Management System Project Propsal Employee Management System Project Propsal
Employee Management System Project Propsal
Syed Junaid
 
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )
Vidhi Kishor
 

Viewers also liked (20)

Project report
Project reportProject report
Project report
 
MOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECT
MOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECTMOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECT
MOVIE TICKET BOOKING-COMPUTER SCIENCE C++ PROJECT
 
c++ report file for theatre management project
c++ report file for theatre management projectc++ report file for theatre management project
c++ report file for theatre management project
 
School Management (c++)
School Management (c++) School Management (c++)
School Management (c++)
 
C++ project on police station software
C++ project on police station softwareC++ project on police station software
C++ project on police station software
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
 
Hotel Management system in C++
Hotel Management system in C++ Hotel Management system in C++
Hotel Management system in C++
 
C++ Project
C++ ProjectC++ Project
C++ Project
 
High performance web programming with C++14
High performance web programming with C++14High performance web programming with C++14
High performance web programming with C++14
 
Reema Agarwal , BCA Third Year
Reema Agarwal , BCA Third YearReema Agarwal , BCA Third Year
Reema Agarwal , BCA Third Year
 
Ravi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearRavi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third Year
 
Binary studio academy 2013 c++ group (andrey and max)
Binary studio academy 2013 c++ group (andrey and max)Binary studio academy 2013 c++ group (andrey and max)
Binary studio academy 2013 c++ group (andrey and max)
 
Rakesh Bijawat , BCA Third Year
Rakesh Bijawat , BCA Third YearRakesh Bijawat , BCA Third Year
Rakesh Bijawat , BCA Third Year
 
programming in C++ report
programming in C++ reportprogramming in C++ report
programming in C++ report
 
Railway reservation(c++ project)
Railway reservation(c++ project)Railway reservation(c++ project)
Railway reservation(c++ project)
 
Bank Management System
Bank Management SystemBank Management System
Bank Management System
 
documentation on bank management system
documentation on bank management systemdocumentation on bank management system
documentation on bank management system
 
Acknowledgement
AcknowledgementAcknowledgement
Acknowledgement
 
Employee Management System Project Propsal
Employee Management System Project Propsal Employee Management System Project Propsal
Employee Management System Project Propsal
 
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )
 

Similar to Computer science project work

Python And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And PythonwinPython And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And Pythonwin
Chad Cooper
 
Sample file processing
Sample file processingSample file processing
Sample file processingIssay Meii
 
MongoDB dla administratora
MongoDB dla administratora MongoDB dla administratora
MongoDB dla administratora
3camp
 
Mongo db dla administratora
Mongo db dla administratoraMongo db dla administratora
Mongo db dla administratora
Łukasz Jagiełło
 
Railway reservation
Railway reservationRailway reservation
Railway reservation
Swarup Boro
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservationSwarup Kumar Boro
 
Computerscience 12th
Computerscience 12thComputerscience 12th
Computerscience 12th
JUSTJOINUS
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2goMoriyoshi Koizumi
 
File handling complete programs in c++
File handling complete programs in c++File handling complete programs in c++
File handling complete programs in c++
zain ul hassan
 
Railwaynew
RailwaynewRailwaynew
Railwaynew
Arsh Vishwakarma
 
maxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingmaxbox starter72 multilanguage coding
maxbox starter72 multilanguage coding
Max Kleiner
 
Assignment no39
Assignment no39Assignment no39
Assignment no39Jay Patel
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
Guillaume Laforge
 
File Handling in C++ full ppt slide presentation.ppt
File Handling in C++ full ppt slide presentation.pptFile Handling in C++ full ppt slide presentation.ppt
File Handling in C++ full ppt slide presentation.ppt
muhazamali0
 
Groovy kind of test
Groovy kind of testGroovy kind of test
Groovy kind of test
Torsten Mandry
 
Groovy kind of test
Groovy kind of testGroovy kind of test
Groovy kind of test
OPITZ CONSULTING Deutschland
 
Apache Commons - Don\'t re-invent the wheel
Apache Commons - Don\'t re-invent the wheelApache Commons - Don\'t re-invent the wheel
Apache Commons - Don\'t re-invent the wheel
tcurdt
 
Gaurav Jatav , BCA Third Year
Gaurav Jatav , BCA Third YearGaurav Jatav , BCA Third Year
Gaurav Jatav , BCA Third Year
dezyneecole
 

Similar to Computer science project work (20)

Python And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And PythonwinPython And GIS - Beyond Modelbuilder And Pythonwin
Python And GIS - Beyond Modelbuilder And Pythonwin
 
Sample file processing
Sample file processingSample file processing
Sample file processing
 
Pdxpugday2010 pg90
Pdxpugday2010 pg90Pdxpugday2010 pg90
Pdxpugday2010 pg90
 
MongoDB dla administratora
MongoDB dla administratora MongoDB dla administratora
MongoDB dla administratora
 
Mongo db dla administratora
Mongo db dla administratoraMongo db dla administratora
Mongo db dla administratora
 
Railway reservation
Railway reservationRailway reservation
Railway reservation
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservation
 
Computerscience 12th
Computerscience 12thComputerscience 12th
Computerscience 12th
 
All I know about rsc.io/c2go
All I know about rsc.io/c2goAll I know about rsc.io/c2go
All I know about rsc.io/c2go
 
File handling complete programs in c++
File handling complete programs in c++File handling complete programs in c++
File handling complete programs in c++
 
Railwaynew
RailwaynewRailwaynew
Railwaynew
 
maxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingmaxbox starter72 multilanguage coding
maxbox starter72 multilanguage coding
 
Assignment no39
Assignment no39Assignment no39
Assignment no39
 
Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008Groovy Introduction - JAX Germany - 2008
Groovy Introduction - JAX Germany - 2008
 
File Handling in C++ full ppt slide presentation.ppt
File Handling in C++ full ppt slide presentation.pptFile Handling in C++ full ppt slide presentation.ppt
File Handling in C++ full ppt slide presentation.ppt
 
Groovy kind of test
Groovy kind of testGroovy kind of test
Groovy kind of test
 
Groovy kind of test
Groovy kind of testGroovy kind of test
Groovy kind of test
 
Apache Commons - Don\'t re-invent the wheel
Apache Commons - Don\'t re-invent the wheelApache Commons - Don\'t re-invent the wheel
Apache Commons - Don\'t re-invent the wheel
 
Dartprogramming
DartprogrammingDartprogramming
Dartprogramming
 
Gaurav Jatav , BCA Third Year
Gaurav Jatav , BCA Third YearGaurav Jatav , BCA Third Year
Gaurav Jatav , BCA Third Year
 

Computer science project work

  • 1.
  • 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