SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdfHarshitSachdeva17
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingHarsh Kumar
 
Report Card making BY Mitul Patel
Report Card making BY Mitul PatelReport Card making BY Mitul Patel
Report Card making BY Mitul PatelMitul Patel
 
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THBANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THSHAJUS5
 
C++ COMPUTER SCIENCE PROJECT
C++ COMPUTER SCIENCE PROJECTC++ COMPUTER SCIENCE PROJECT
C++ COMPUTER SCIENCE PROJECTAbhishek Shukla
 
Library Management Project (computer science) class 12
Library Management Project (computer science) class 12Library Management Project (computer science) class 12
Library Management Project (computer science) class 12RithuJ
 
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...ArkaSarkar23
 
computer science project class 12th
computer science project class 12thcomputer science project class 12th
computer science project class 12thNitesh Kushwaha
 
Computer Science Investigatory Project
Computer Science Investigatory ProjectComputer Science Investigatory Project
Computer Science Investigatory ProjectPrakhar Seth
 
Student DATABASE MANAGeMEnT SysTEm
Student DATABASE MANAGeMEnT SysTEmStudent DATABASE MANAGeMEnT SysTEm
Student DATABASE MANAGeMEnT SysTEmhome
 
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
 
cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IPD. j Vicky
 
BOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in PythonBOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in Pythonvikram mahendra
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project  12th CBSE Computer Science Project
12th CBSE Computer Science Project Ashwin Francis
 
C.S. project report on railway ticket reservation
C.S. project report on railway ticket reservationC.S. project report on railway ticket reservation
C.S. project report on railway ticket reservationVirat Prasad
 
Informatics Practices/ Information Practices Project (IP Project Class 12)
Informatics Practices/ Information Practices Project (IP Project Class 12)Informatics Practices/ Information Practices Project (IP Project Class 12)
Informatics Practices/ Information Practices Project (IP Project Class 12)KushShah65
 
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILECOMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILEAnushka Rai
 
Computer Science investigatory project class 12
Computer Science investigatory project class 12Computer Science investigatory project class 12
Computer Science investigatory project class 12Raunak Yadav
 

Tendances (20)

Computer science project.pdf
Computer science project.pdfComputer science project.pdf
Computer science project.pdf
 
Computer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market BillingComputer science class 12 project on Super Market Billing
Computer science class 12 project on Super Market Billing
 
Report Card making BY Mitul Patel
Report Card making BY Mitul PatelReport Card making BY Mitul Patel
Report Card making BY Mitul Patel
 
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12THBANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
BANK MANAGEMENT INVESTIGATORY PROJECT CLASS 12TH
 
C++ COMPUTER SCIENCE PROJECT
C++ COMPUTER SCIENCE PROJECTC++ COMPUTER SCIENCE PROJECT
C++ COMPUTER SCIENCE PROJECT
 
Library Management Project (computer science) class 12
Library Management Project (computer science) class 12Library Management Project (computer science) class 12
Library Management Project (computer science) class 12
 
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
Computer Science Investigatory Project Class XII CBSE(Latest Syllabus)(Python...
 
computer science project class 12th
computer science project class 12thcomputer science project class 12th
computer science project class 12th
 
Computer Science Investigatory Project
Computer Science Investigatory ProjectComputer Science Investigatory Project
Computer Science Investigatory Project
 
Project report
Project reportProject report
Project report
 
Student DATABASE MANAGeMEnT SysTEm
Student DATABASE MANAGeMEnT SysTEmStudent DATABASE MANAGeMEnT SysTEm
Student DATABASE 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 )
Computer project C++ CLASS 12TH (CD MANAGEMENT SYSTEM )
 
cbse 12 computer science IP
cbse 12 computer science IPcbse 12 computer science IP
cbse 12 computer science IP
 
BOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in PythonBOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in Python
 
12th CBSE Computer Science Project
12th CBSE Computer Science Project  12th CBSE Computer Science Project
12th CBSE Computer Science Project
 
Ip project
Ip projectIp project
Ip project
 
C.S. project report on railway ticket reservation
C.S. project report on railway ticket reservationC.S. project report on railway ticket reservation
C.S. project report on railway ticket reservation
 
Informatics Practices/ Information Practices Project (IP Project Class 12)
Informatics Practices/ Information Practices Project (IP Project Class 12)Informatics Practices/ Information Practices Project (IP Project Class 12)
Informatics Practices/ Information Practices Project (IP Project Class 12)
 
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILECOMPUTER SCIENCE CLASS 12 PRACTICAL FILE
COMPUTER SCIENCE CLASS 12 PRACTICAL FILE
 
Computer Science investigatory project class 12
Computer Science investigatory project class 12Computer Science investigatory project class 12
Computer Science investigatory project class 12
 

En vedette

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++ PROJECTSindhu 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 projectRajesh Gangireddy
 
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
 
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++14Matthieu Garrigues
 
Reema Agarwal , BCA Third Year
Reema Agarwal , BCA Third YearReema Agarwal , BCA Third Year
Reema Agarwal , BCA Third YearDezyneecole
 
Ravi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearRavi Prakash Yadav , BCA Third Year
Ravi Prakash Yadav , BCA Third YearDezyneecole
 
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 YearDezyneecole
 
programming in C++ report
programming in C++ reportprogramming in C++ report
programming in C++ reportvikram 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
 
Employee Management System Project Propsal
Employee Management System Project Propsal Employee Management System Project Propsal
Employee Management System Project Propsal Syed Junaid
 
Online railway reservation system
Online railway reservation systemOnline railway reservation system
Online railway reservation systemPIYUSH Dubey
 
SYNOPSIS ON BANK MANAGEMENT SYSTEM
SYNOPSIS ON BANK MANAGEMENT SYSTEMSYNOPSIS ON BANK MANAGEMENT SYSTEM
SYNOPSIS ON BANK MANAGEMENT SYSTEMNitish Xavier Tirkey
 
Petrol station safety
Petrol station safetyPetrol station safety
Petrol station safetyZay Yar Tun
 

En vedette (20)

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 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
 
Online railway reservation system
Online railway reservation systemOnline railway reservation system
Online railway reservation system
 
SYNOPSIS ON BANK MANAGEMENT SYSTEM
SYNOPSIS ON BANK MANAGEMENT SYSTEMSYNOPSIS ON BANK MANAGEMENT SYSTEM
SYNOPSIS ON BANK MANAGEMENT SYSTEM
 
Petrol station safety
Petrol station safetyPetrol station safety
Petrol station safety
 

Similaire à 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 PythonwinChad Cooper
 
Sample file processing
Sample file processingSample file processing
Sample file processingIssay Meii
 
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
 
MongoDB dla administratora
MongoDB dla administratora MongoDB dla administratora
MongoDB dla administratora 3camp
 
Railway reservation
Railway reservationRailway reservation
Railway reservationSwarup 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 12thJUSTJOINUS
 
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
 
maxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingmaxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingMax 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 - 2008Guillaume Laforge
 
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 wheeltcurdt
 
Gaurav Jatav , BCA Third Year
Gaurav Jatav , BCA Third YearGaurav Jatav , BCA Third Year
Gaurav Jatav , BCA Third Yeardezyneecole
 

Similaire à 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
 
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
 
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
 
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

  • 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