computerscience projectwork

Upload: ayushagrawal

Post on 02-Jun-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 computerscience projectwork

    1/27

  • 8/10/2019 computerscience projectwork

    2/27

    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, employeeid 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

  • 8/10/2019 computerscience projectwork

    3/27

    SERIAL

    NUMBER

    CONTENTS PAGE NUMBER

    1. CERTIFICATE. 4

    2. EMPLOYEE DATABASE

    MANAGEMENT

    SYSTEM PROGRAME.

    519

    3. OUTPUT OF THE

    PROGRAME.

    20

    4. BIBLIOGRAPHY. 21

    5. THANKS PAGE. 22

    3

  • 8/10/2019 computerscience projectwork

    4/27

    This is to certify that Rahul Tripathi and Utkarsh Srivastva

    of class XII has successfully completed this computer

    project on the topic Employee Database ManagementSystem 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

  • 8/10/2019 computerscience projectwork

    5/27

    #include

    #include

    #include

    #include

    #include

    #include

    #include

    #include

    class group

    {

    private:

    struct person

  • 8/10/2019 computerscience projectwork

    6/27

    {

    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();

  • 8/10/2019 computerscience projectwork

    7/27

    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/10/2019 computerscience projectwork

    8/27

    // 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

  • 8/10/2019 computerscience projectwork

    9/27

    cout

  • 8/10/2019 computerscience projectwork

    10/27

    {

    case '1':

    g.addrec();

    break;

    case'2':

    g.listrec();

    break;

    case'3':

    g.modirec();

    break;

    case'4':

    g.delrec();

    break;

    case'5':

  • 8/10/2019 computerscience projectwork

    11/27

    g.recallrec();

    break;

    case'6':

    g.packrec();

    break;

    case'0':

    g.exit();

    exit(1);

    }

    }

    while(choice!=0);

    }

  • 8/10/2019 computerscience projectwork

    12/27

    void group::group()

    {

    file.open("Emp.dat",ios::binary|ios::in|ios::out);

    p.flag=' ';

    if(!file)

    {

    cout

  • 8/10/2019 computerscience projectwork

    13/27

    p.day=d.day;

    p.month=d.month;

    p.year=d.year;

    cout

  • 8/10/2019 computerscience projectwork

    14/27

    }

    cin>>p.empcode>>p.name>>p.age>>p.sal;

    p.flag=' ';

    file.write((char*)&p,sizeof(p));

    coutch;

    }

    while(ch=='y'||ch=='Y');

    }

    void group::listrec()

    {

    int j=0,a;

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

    cout

  • 8/10/2019 computerscience projectwork

    15/27

    cout

  • 8/10/2019 computerscience projectwork

    16/27

    gotoxy(10,10);

    cout

  • 8/10/2019 computerscience projectwork

    17/27

    cout>code;

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

    while(file.read((char*)&p,sizeof(p)))

    {

    if(strcmp(p.empcode,code)==0)

    {

    cout

  • 8/10/2019 computerscience projectwork

    18/27

    p.flag=' ';

    pos=count*sizeof(p);

    file.seekp(pos,ios::beg);

    file.write((char*)&p,sizeof(p));

    return;

    }

    count++;

    }

    cout

  • 8/10/2019 computerscience projectwork

    19/27

    coutcode;

    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

  • 8/10/2019 computerscience projectwork

    20/27

    cout

  • 8/10/2019 computerscience projectwork

    21/27

    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

  • 8/10/2019 computerscience projectwork

    22/27

    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);

  • 8/10/2019 computerscience projectwork

    23/27

    gotoxy(10,10);

    cout

  • 8/10/2019 computerscience projectwork

    24/27

    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

  • 8/10/2019 computerscience projectwork

    25/27

    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

  • 8/10/2019 computerscience projectwork

    26/27

    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 reallyhelped us to understand the concepts of C++ computer

    programming.

    22

  • 8/10/2019 computerscience projectwork

    27/27