wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace each instance of same word. Save and protect your document. Steps for

Embed Size (px)

Citation preview

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    1/60

    Create a document containing text that should be properly aligned. Use the replace

    all option to replace each instance of same word. Save and protect your document.

    Steps for Replace all:

    Click Replace option in Find and Replace option in Home Tab.

    Type the word in Find what option you want to replace.

    Now type the word with which you want to replace previous word in Replacewith option.

    Now click on Replace all option.

    A

    Proect !ile

    "n

    C##

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    2/60

    / This pro!ect is basically "or the user#s who want to develop C$$ menu driven pro%ramsand buildin% application throu%h their real li"e. &t

    contains an assumend e'ample o" an or%ani(ation )*+, Company-. The personnel

    department o" the or%ani(ation interacts with re%ard to the employeemana%ment the !ob criteria and salary behaviour o" about more than 00 employees.

    1lso they have number o" terms and contitions "or employees )which is %iven

    in the pro%rams by comment line either in // or / -. &t comprises a menu driven pro%ram

    and includes number o" options procedures "or each selective modules

    with a complete class declaration o" 223s concept. The complete pro!ect handles twodata bases as 45T1&67.dat and 583.dat. This pro!ect includes number o" libraries

    includin% di""erent header "iles and their respective "unctions which is noted down a"terthe source code o" the pro!ect.

    1ccordin% to the re9uirements the employer deals with certain attributes like:emp;no < 5mployee number

    name < 5mployee name

    address < 5mployee addressdd mm yy < 4ate o" birth = date o" !oinin%

    city < 5mployee city

    state < 5mployee state(ip < 5mployee ,ip codesalary < 5mployee basic salary

    %rade < 5mployee %rade accordin% to %rade calculation

    emp;!ob < 5mployee !ob/desi%nationdeptno < 5mployee department number

    1nd the above attributes are divided into two databases as: 45T1&67.dat = 583.dat data"ile

    The "ield contents o" 45T1&67.dat as:

    int emp;no>

    char name?@0A address?@0A>int dd mm yy>

    char city?0A state?BA (ip?0A>

    and the "ields contents o" 583.dat as:int emp;no>

    int dd mm yy>

    char %rade?BA>char emp;!ob?BA>

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    3/60

    "loat salary>

    int deptno>

    This pro!ect is developed usin% C$$ class concepts and havin% number o" di""erent

    user de"ined "unction )4Fs- as "ollows:

    4R1D;6&N5).....-

    This "unction passes "our parameters includin% three inte%er and one character todraw di""erent lines to desi%n the screen beauti"ul. The character parameter draw the

    17C&& character line

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    4/60

    the 2pen New 5mployee o" 81&N;7CR55N)- "unction because the 2pen New

    5mployee "orm automatically creates

    the employee number a"ter a brie" search to the e'istin% employee numbers. asicallythe numbers are %eneratin% automatically like your #ankin% 3ro!ect#.

    583;1335N4).....-

    The 583;1335N4)- "unction declared in both details and employee class. This "unction

    is used to append new records into both 45T1&6.dat and 583.dat data "ileby passin% their recpective parameters.

    modi"y)-

    This "unction is used to display a modi"ication screen "or modi"yin% the employee details

    by enterin% the employee number. Dhile modi"yin% the employee number

    )emp;no- will be entered by the user and will search in both the data bases and then the

    respective records can modi"ied.The "unction uses a "unction "ound;employee)- to search the particular employee is e'ists

    or not. &" e'ists then the "unctiondisplay)..- will display the details o" employee "rom 45T1&67.dat and 583.dat data "ile.

    1"ter modi"yin% the data it a%ain

    re

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    5/60

    %eneratin% the ne't employee number automatically.

    "ound;employee).....-

    1s the pro!ect operated with only the key "ield employee number and when the employee

    number entered it always checks in the data base 45T1&67.dat that whether theemployee is e'ist or not. &" e'ists then "urther

    the employee can processed eiter "or modi"y delete display or etc.

    return;name)...-

    &" their is any re9uirement o" the employee name to display at any momemt then this

    "unction returns the name o" the employee "rom45T1&67.dat data "ile with the parameter employee number )emp;no-. This "unction

    uses emp;no as the parameter to search in the data base.

    return;address)...-

    &" their is any re9uirement o" the employee address to display at any momemt then this"unction returns the address o" the employee "rom

    45T1&67.dat data "ile with the parameter employee number )emp;no-. This "unction

    uses emp;no as the parameter to search in the data base.

    display;"rom;details)...-

    This "unction is used to display the employee details "rom 45T1&67.dat data "ile. e"oredisplayin% the name and address in"ormation the "uction

    passes emp;no as a parameter "or which employee detail is to display. &" the employee

    no. "ound the the related in"ormations will display in the screen.s

    recordno)...-

    This is very important "unction which returns the record position in the data "ile. Dhile

    knowin% the record number it will easy "or modi"yin% the e'istin% employee details in

    both 45T1&67.dat and 583.dat data "iles.

    display)...-

    This "unction is used to display the in"ormation related to employee number.ecause this "unction passes a parameter emp;no and accordin% the number the

    in"ormation is displayed.

    This is a multi

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    6/60

    Dhile %eneratin% a salary report this "unction displays the name and address in"ormation

    "rom 45T1&67.dat data "ile with the help o"

    employee number )emp;no as a parameter-.

    modi"y;employee)...-

    This "unction is used to re

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    7/60

    all other bene"its and deductions will calculated includin% income ta' )as on table %iven

    be"ore the "unction source code-. The "inal net salary displays individually employee wise

    on screen.

    modi"y;salary)-

    The "unction modi"y;salary)- is used to re

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    8/60

    display;"rom;details to display the in"ormations "rom 45T1&67.dat data "ile accourdin%

    to the employee number

    which is one o" the parameter in both bo';"or;display)- and display;"rom;details)-"unctions.

    /

    // 4eclaration o" header "ilesLinclude Miostream.h

    Linclude M"stream.h

    Linclude Mprocess.h

    Linclude Mstrin%.hLinclude Mstdio.h

    Linclude Mctype.h

    Linclude Mconio.h

    Linclude Mdos.hLinclude Mstdlib.h

    Linclude Miomanip.h

    // This "ile includede "rom your library directory or compiler to support the %raphics

    modeLinclude %h.cpp

    class 2*;C6177

    Opublic:

    void 4R1D;6&N5)int int int char->

    void 4R1D;E5R)int int int char->void 4R1D;2*)int int int int char->

    P>

    // Class "or main control

    class control

    O

    public:void 81&N;7CR55N)void->

    void help)void->

    private:void 85N;54&T)void->

    P>

    // details class "or employee address section

    class details

    O

    public:

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    9/60

    void 583;1335N4)int char t;name?@0A char t;address?@0A int tdd int

    tmm int tyy char t;city?0A char t;state?@A char t;(ip?0A->

    void display;emp;list)void-> // 4isplayin% customers employee listvoid delete;employee)int-> // 4eletin% customers employee

    void modi"y)void-> // To modi"y the customer employee in"ormation

    int last;emp;no)void-> // To know the last employee numberint "ound;employee)int-> // To "ound the employee is in 45T1&67.dat or

    not

    char return;name)int-> // Function "or validation entry o" customer name

    char return;address)int-> // Function "or validation entry o" customer

    address

    void display;"rom;details)int-> // Function "or displayin% all the details"rom 45T1&67.dat data "ile

    int recordno)int->

    void display)int-> // To display the customer employee

    void send;41T1)int-> // 7end details in"ormation into salary report

    private:void modi"y;employee)int char t;name?@0A char t;address?@0A int tdd

    int tmm int tyy char t;city?0A char t;state?@A char t;(ip?0A-> // Function to modi"y

    the customer employee// void bo';"or;list)void-> // 4rawin% a bo'>

    int emp;no>

    char name?@0A address?@0A>

    int dd mm yy>char city?0A state?@A (ip?0A>

    P>

    // employee class "or salary and desi%nation

    class employee

    Opublic:

    void new;employee)void-> // Function to create a new employee

    void close;employee)void-> // Function to close an employee

    void display;employee)void-> // Function to display the employeesvoid 6e"t;clear)int int-> // Function to per"orm a le"t clear on speci"ied

    row "rom a speci"ied column

    void Ri%ht;clear)int int-> // Function to per"orm a ri%ht clear on speci"iedrow "rom a speci"ied column

    void month;salary)void-> // Function to list monthDise chan%e;salary

    reportvoid display)int-> // Function to display a chan%e;salary employee

    void modi"y;salary)int int int int char t;%rade?BA char t;emp;!ob?BA

    "loat int-> // Function to modi"y other in"ormations related to employee

    int recordno)int->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    10/60

    "loat "ound;salary)int-> // Function to "ind salary "rom 583.dat data

    "ile

    char "ound;!ob)int-> // Function to "ind the employee !ob "or displayin% atotal list

    void chan%e;salary)void-> // Function to chan%e the employee salary

    private:

    void 583;1335N4)int int int int char t;%rade?BA char t;emp;!ob?BA

    "loat int-> // Function to add chan%e;salary recordsvoid delete;employee)int-> // Function to delete a chan%e;salary record

    void bo';"or;display)int-> // Function "or displayin% bo'

    int emp;no>

    int dd mm yy> // To store the system date/ 5nter datechar %rade?BA> // 1s the employee type is 4eposit or

    Dithdraw

    char emp;!ob?BA> // employee type as Che9ue or Cash

    "loat salary>int deptno>

    P>

    // Function "or hori(ontal line draw

    void 2*;C6177::4R1D;6&N5)int column int columnB int row char c-O

    "or )column> column MQ columnB> column$$-

    O

    %oto'y)column row->cout MM c>

    P

    P

    // Function "or vertical line draw

    void 2*;C6177::4R1D;E5R)int row int rowB int column char c-O

    "or )row> row MQ rowB> row$$-

    O

    %oto'y)column row->cout MM c>

    P

    P

    void 2*;C6177::4R1D;2*)int column int row int columnB int rowB char c-

    Ochar ch Q B>

    char c cB c@ cS>

    char l Q JG lB Q KJ>

    i" )c QQ ch-

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    11/60

    O

    c Q B>

    cB Q J>c@ Q BK>

    cS Q BK>

    l Q JG>lB Q KJ>

    P

    elseO

    c Q c>

    cB Q c>

    c@ Q c>cS Q c>

    l Q c>

    cB Q c>

    P%oto'y)column row->

    cout MM c>%oto'y)columnB row->

    cout MM cB>

    %oto'y)column rowB->cout MM c@>

    %oto'y)columnB rowB->

    cout MM cS>

    column$$>columnB //Hori(ontal line

    4R1D;6&N5)column columnB rowB l->column

    row$$>rowB // Eertical line

    4R1D;E5R)row rowB columnB lB->

    P

    // Function "or main menu

    void control::81&N;7CR55N)void-O

    char ch>

    / re9uest auto detection o" %raph driver/

    int %driver Q 45T5CT %mode errorcode>

    while )ch MQ #G#-

    O

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    12/60

    // &nitiali(es the %raphics system

    init%raph)=%driver =%mode ->

    2*;C6177 s>

    // setbkcolor sets the current back%round color usin% the palette

    setbkcolor)0->

    // setcolor sets the current drawin% color

    setcolor)R54->

    // 7ets the current te't characteristicssette'tstyle)0H2R&,;4&R-> // Chan%es the te't style )"ont-

    // outte't'y displays a strin% at the speci"ied location )%raphics mode-

    outte't'y)SB0J0 M0 Q 5'it-> // To display a te't in a particularrow and coloumn position

    setcolor)->

    sette'tstyle)H2R&,;4&RB->

    // outte't'y displays a strin% at the speci"ied location )%raphics mode-

    outte't'y)K0@0 4eveloped by 1uthor = Her Team->

    outte't'y)BB0058362+55 85N->

    sette'tstyle)@H2R&,;4&R->

    setcolor)R54->

    outte't'y)BB0S0 . 2pen New employee->outte't'y)BB0G0 B. 6ist o" employees->

    outte't'y)BB00@. 7ee &ndividual employee->

    outte't'y)BB0B00 S. 5mpChan%e;salary->outte't'y)BB0BB0 . 7alary7lip->

    outte't'y)BB0BS0 G. 5dit employee->

    outte't'y)B@0@005nter +our Choice ->

    // 4raws a rectan%le )%raphics mode-

    rectan%le)B00B0SBKK->

    rectan%le)S00@0KS0@BK->

    ch Q %etche)->

    // 7huts down the %raphics system

    close%raph)->

    switch )ch-

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    13/60

    O

    case #0#:

    clrscr)->e'it)0-> // 2ption to e'it "rom main menu

    break>

    case ##:O

    employee a>

    a.new;employee)-> // New employee member "unctionbreak>

    P

    case #B#:

    Odetails 583;144>

    583;144.display;emp;list)-> // Ulo%al list o" employee

    "unction

    break>P

    case #@#:O

    employee a>

    a.display;employee)-> // 4isplayin% individual employeesall chan%e;salary

    break>

    P

    case #S#:O

    employee a>

    a.chan%e;salary)-> // 4aily chan%e;salary "or individualemployee

    break>

    Pcase ##:

    O

    employee a>

    a.month;salary)-> // 8onthly report "or any employeebreak>

    P

    case #G#:O

    init%raph)=%driver =%mode ->

    85N;54&T)-> // 7ub menu "or modi"yin% or deletin% anyemployee

    break>

    P

    P

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    14/60

    P

    "or )int i Q B> i Q > ioutte't'y)BG0054&T 85N->

    setcolor)S->

    rectan%le)B00B0SBKK->sette'tstyle)@H2R&,;4&R->

    outte't'y)BB0@0 : 8odi"y employee->

    outte't'y)BB0G0B. Close employee->outte't'y)BB0J00. Vuit->

    outte't'y)B@0BB05nter your choice : ->ch Q %etche)->

    close%raph)->i" )ch QQ BK-

    break>

    else

    i" )ch QQ ##-O

    details 583;144>

    583;144.modi"y)->break>

    P

    elsei" )ch QQ #B#-

    O

    employee a>

    a.close;employee)->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    15/60

    break>

    P

    elsei" )ch QQ #0#-

    break>

    PP

    // Function "or help menuvoid control::help)void-

    O

    // %etch %ets a character "rom console but does not echo to the screen

    %etch)->

    clrscr)->

    2*;C6177 s>

    s.4R1D;2*)B KJ B B->s.4R1D;2*)B B S S BJ->

    %oto'y)BK @->

    // cprint" sends "ormatted output to the te't window on the screen

    cprint")Delcome to 5mployee 3ro!ect->

    // te'tcolor selects a new character color in te't mode

    te'tcolor)6&UHTUR1+->

    delay)B->

    %oto'y) G->

    cout MM This pro!ect is used to handle the employees in an or%ani(ation and >delay)B->

    %oto'y) K->

    cout MM "or keepin% the employee detailed in"ormation is computeri(edmanner.>

    delay)B->

    %oto'y) J->

    cout MM 1nd also handles the "ollowin% option as "ollows: >%oto'y)G ->

    cout MM

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    16/60

    cout MM

    delay)B->

    %oto'y)K G->cout MM o" individual employee.>

    %oto'y)G K->

    cout MM

    cout MM Dhere it will display two another prompts in the sub menu.>

    delay)B->%oto'y)G J->

    cout MM delay)B->

    %oto'y)@ BB->

    cout MM simply came back to the previous menu or to the source pro%ram.>delay)B->

    te'tcolor)61CW$6&NW->

    te'tback%round)DH&T5->

    %oto'y)BG B->

    cprint")3ress any key to continue...->te'tcolor)6&UHTUR1+->

    te'tback%round)61CW->

    %oto'y)B B->%etch)->

    "or )int i Q B> i Q > i

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    17/60

    char t;acc?0A>

    int t t;emp;no>

    %oto'y)K ->cout MM M0Q5'it>

    %oto'y)->

    cout MM 5nter the employee no. >%ets)t;acc->

    t Q atoi)t;acc->

    t;emp;no Q t>i" )t;emp;no QQ 0-

    return>

    clrscr)->

    i" )I"ound;employee)t;emp;no--

    O

    %oto'y) ->

    cout MM XK5mployee not "ound>%etch)->

    return>P

    %oto'y)K ->cout MM M0Q5'it>

    te'tback%round)DH&T5->

    %oto'y)@ @->

    "or )! Q > !MQ KG> !$$-cprint") ->

    te'tback%round)61CW->

    te'tcolor)61CW$6&NW->te'tback%round)DH&T5->

    %oto'y)@0 @->

    cprint")8odi"y 5mployee 7creen->te'tcolor)6&UHTUR1+->

    te'tback%round)61CW->

    int d m y>struct date d> // For e'tractin% system date

    %etdate)=d->

    d Q d.da;day>m Q d.da;mon>

    y Q d.da;year>

    %oto'y)S B->cout MM 4ate: MM d MM / MM m MM / MM y>

    char ch>

    // 4isplayin% "rom 45T1&67.dat data "ile

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    18/60

    display)t;emp;no->

    employee a>

    // 4isplayin% "rom 583.dat data "ile

    a.display)t;emp;no->

    do

    Oa.6e"t;clear) ->

    %oto'y)B @->

    "or )! Q > !MQ KG> !$$-

    cprint")Q->te'tback%round)DH&T5->

    te'tback%round)61CW->

    te'tcolor)61CW->

    te'tback%round)DH&T5->%oto'y)B0 S->

    cprint")8odi"y This 5mployee My/nY ->ch Q %etch)->

    te'tcolor)6&UHTUR1+->

    te'tback%round)61CW->%oto'y)B ->

    "or )! Q > !MQ KG> !$$-

    cprint")Q->

    i" )ch QQ #0#-

    return>

    ch Q toupper)ch->Pwhile )ch IQ #N# == ch IQ #+#->

    i" )ch QQ #N#-

    return>

    // 4eclared the temporary "ields "or modi"yin% data a%ain

    int modi"ied Q 0 valid>

    char t;name?@0A t;address?@0A>char t;city?0A t;state?@A t;(ip?0A>

    char t;emp;!ob?BA>

    int tdd tmm tyy>int t;deptno>

    "loat t;salary>

    char t;%rade?BA>

    // 4isplays the headin%s

    %oto'y) G->

    cout MM Name : >

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    19/60

    %oto'y) K->

    cout MM 1ddress : >

    %oto'y) ->cout MM 4ate o" irth : >

    %oto'y) J->

    cout MM City : >%oto'y) B0->

    cout MM 7tate : >

    %oto'y) B->cout MM ,ip : >

    %oto'y)S0 G->

    cout MM 4esi%nation : >

    %oto'y)S0 K->cout MM 4ate o" Zoinin% : >

    %oto'y)S0 ->

    cout MM 4epartment no. : >

    %oto'y)S0 J->cout MM asic 7alary >

    %oto'y)S0 B0->cout MM Urade : >

    doO

    a.6e"t;clear)B G->

    a.6e"t;clear) B@->

    %oto'y) B@->cout MM 5nter Name or 3ress 5nter "or No Chan%e>

    valid Q >

    %oto'y)B G->%ets)t;name->

    strupr)t;name->

    i" )t;name?0A QQ #0#-return>

    i" )strlen)t;name- B-

    O

    valid Q 0>%oto'y) B@->

    cprint")XKName should not %reater than B->

    %etch)->P

    P while )Ivalid->

    do

    O

    a.6e"t;clear) K->

    a.6e"t;clear) B@->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    20/60

    %oto'y) B@->

    cout MM 5nter 1ddress or press enter "or no Chan%e>

    valid Q >%oto'y) K->

    %ets)t;address->

    strupr)t;address->i" )t;address?0A QQ #0#-

    return>

    i" )strlen)t;address- B-O

    valid Q 0>

    %oto'y) B@->

    cprint")XK1ddress should not %reater than B->%etch)->

    P

    P while )Ivalid->

    i" )strlen)t;address- 0-

    modi"ied Q >i" )Imodi"ied-

    return>

    a.6e"t;clear)B ->

    %oto'y) B@->

    cout MM 5nter 4ate o" irth >

    %oto'y)B ->cin tdd>

    %oto'y)B@ ->

    cout MM %oto'y)BS ->

    cin tmm>

    %oto'y)BG ->cout MM

    %oto'y)BK ->

    cin tyy>

    a.6e"t;clear)B@->

    do

    Oa.6e"t;clear)B J->

    a.6e"t;clear) B@->

    %oto'y) B@->cout MM 5nter City and press enter "or no chan%e>

    valid Q >

    %oto'y)B J->

    %ets)t;city->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    21/60

    i" )t;city?0A QQ #0#-

    return>

    i" )strlen)t;city- J-O

    valid Q 0>

    %oto'y) B@->cprint")XKCity should not %reater than J->

    %etch)->

    PP while )Ivalid->

    a.6e"t;clear) B@->

    doO

    a.6e"t;clear)S B0->

    a.6e"t;clear) B@->

    %oto'y) B@->cout MM 5nter 7tate and press enter "or no chan%e>

    valid Q >%oto'y)S B0->

    %ets)t;state->

    strupr)t;state->i" )t;state?0A QQ #0#-

    return>

    i" )strlen)t;state- QQ 0 [[ strlen)t;state- B-

    Ovalid Q 0>

    %oto'y) B@->

    cprint")XK7tate should not %reater than ->%etch)->

    P

    P while )Ivalid->a.6e"t;clear) B@->

    do

    Oa.6e"t;clear) B->

    a.6e"t;clear) B@->

    %oto'y) B@->cout MM 5nter ,ip Code and enter "or no chan%e>

    valid Q >

    %oto'y) B->%ets)t;(ip->

    strupr)t;(ip->

    i" )t;(ip?0A QQ #0#-

    return>

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    22/60

    i" )strlen)t;(ip- QQ 0 [[ strlen)t;(ip- J-

    O

    valid Q 0>%oto'y) B@->

    cprint")XK,ip should not %reater than J->

    %etch)->P

    P while )Ivalid->

    a.6e"t;clear) B@->

    do

    O

    a.Ri%ht;clear)J G->a.6e"t;clear) B@->

    %oto'y) B@->

    cout MM 5nter 4esi%nation and 5nter "or no chan%e>

    valid Q >%oto'y)J G->

    %ets)t;emp;!ob->strupr)t;emp;!ob->

    i" )t;emp;!ob?0A QQ #0#-

    return>i" )strlen)t;emp;!ob- QQ 0 [[ strlen)t;emp;!ob- -

    O

    valid Q 0>

    %oto'y) B@->cprint")XK4esi%nation should not %reater than J->

    %etch)->

    PP while )Ivalid->

    a.Ri%ht;clear)J K->

    %oto'y)J K->

    cin d>

    %oto'y)G K->

    cout MM %oto'y)GB K->

    cin m>

    %oto'y)GS K->cout MM

    %oto'y)G K->

    cin y>

    %oto'y)J ->

    cin t;deptno>

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    23/60

    do

    O

    a.Ri%ht;clear)J J->a.6e"t;clear) B@->

    %oto'y) B@->

    cout MM asic 7alary not less that B00>valid Q >

    char t?0A> // 4eclare as character type and will convert into "loat type

    usin% ato")- "unction%oto'y)J J->

    %ets)t->

    t;salary Q ato")t->

    i" )t?0A QQ #0#-O

    valid Q 0>

    %oto'y) B@->

    cprint")XK7hould not less than B00->%etch)->

    PP while )Ivalid->

    i" )t;salary Q B00 == t;salary MQ @000-O

    strcpy)t;%rade C->

    P

    elsei" )t;salary Q @00 == t;salary MQ S000-

    O

    strcpy)t;%rade ->P

    else

    i" )t;salary Q S00 == t;salary MQ 000-O

    strcpy)t;%rade 1->

    P

    elsei" )t;salary 000-

    O

    strcpy)t;%rade 2->P

    else

    return>

    %oto'y)J B0->

    cout MM t;%rade> // Calculate a %rade "unction at here

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    24/60

    do

    O

    a.6e"t;clear) B@->%oto'y) BB->

    cout MM 4o you want to save Chan%es M+/N: >

    ch Q %etche)->i" )ch QQ #0#-

    return>

    ch Q toupper)ch->P while )ch IQ #N# == ch IQ #+#->

    i" )ch QQ #N#-

    return>

    // Function to rewrite the name and address details into 45T1&67.41T

    modi"y;employee)t;emp;no t;name t;address tdd tmm tyy t;city t;state

    t;(ip->

    // Function to rewrite the salary and !ob details into 583.41T

    a.modi"y;salary)t;emp;no d m y t;%rade t;emp;!ob t;salary t;deptno->

    %oto'y) B@->

    cout MM XKRecord modi"ied>%oto'y)B B@->

    cout MM 3ress any key to continue...>

    %etch)->

    P

    // 4isplay the record "rom 45T1&67.dat data "ile "or modi"yin% display

    void details::display)int t;emp;no-O

    "stream "ile>

    int d m y>"ile.open)45T1&67.dat ios::in->

    "ile.seek%)0 ios::be%->

    while )"ile.read))char -this si(eo")details---O

    i" )t;emp;no QQ emp;no-

    O%oto'y) S->

    cout MM 5mployee no. MM emp;no>

    %oto'y)0 G->cout MM Name : >

    puts)name->

    %oto'y)0 K->

    cout MM 1ddress : >

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    25/60

    puts)address->

    %oto'y)0 ->

    d Q dd>m Q mm>

    y Q yy>

    cout MM 4ate o" irth MM d MM

    cout MM 7tate : >

    puts)state->

    %oto'y)0 ->cout MM ,ip : >

    puts)(ip->

    %etch)->

    break>P

    P"ile.close)->

    P

    // 4isplay the record "rom 583.dat data "ile "or modi"yin% display

    void employee::display)int t;emp;no-

    O

    "stream s"ile>s"ile.open)583.dat ios::in->

    s"ile.seek%)0 ios::be%->

    while )s"ile.read))char -this si(eo")employee---

    O

    i" )t;emp;no QQ emp;no-O

    %oto'y)S0 G->

    cout MM 4esi%nation : >

    puts)emp;!ob->%oto'y)S0 K->

    cout MM Zoinin% 4ate : >

    %oto'y)J K->cout MM dd MM

    cout MM asic 7alary R7. MM setw)- // setwidth

    MM setprecision)B- // set position o"

    decimal point

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    26/60

    MM setios"la%s)ios::le"t- // set le"t !usti"ied

    output

    MM setios"la%s)ios::showpoint- // alwaysshow decimal point

    MM setios"la%s)ios::"i'ed- // set "i'ed

    notation "or display MM salary>

    %oto'y)S0 0->

    cout MM Urade : MM %rade>break>

    P

    P

    s"ile.close)->P

    // Function to insert modi"yed data into 45T1&67.dat data "ile

    void details::modi"y;employee)int t;emp;no char t;name?@0A char t;address?@0A inttdd int tmm int tyy char t;city?0A char t;state?@A char t;(ip?0A-

    Oint recno>

    recno Q recordno)t;emp;no->

    "stream "ile>"ile.open)45T1&67.dat ios::out[ios::ate->

    emp;no Q t;emp;no>

    strcpy)name t;name->strcpy)address t;address->

    dd Q tdd>

    mm Q tmm>yy Q tyy>

    strcpy)city t;city->

    strcpy)state t;state->strcpy)(ip t;(ip->

    // Findin% the location in "ile

    int location Q 0>location Q )recno// 7earch the position in "ile

    "ile.seekp)location->

    // Re

    return>

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    27/60

    P

    // Function to modi"y data related to salary in 583.datvoid employee::modi"y;salary)int t;emp;no int d int m int y char t;%rade?BA char

    t;emp;!ob?BA "loat t;salary int t;deptno-

    O int recno Q 0>

    recno Q recordno)t;emp;no->

    "stream s"ile>s"ile.open)583.dat ios::out[ios::ate->

    emp;no Q t;emp;no>

    dd Q d>mm Q m>

    yy Q y>

    strcpy)%rade t;%rade->

    strcpy)emp;!ob t;emp;!ob->salary Q t;salary>

    deptno Q t;deptno>

    // Find the location in "ile

    int location Q 0>

    location Q )recno

    // 7earch the position in "ile

    s"ile.seekp)location->

    // Re

    return>

    P

    // Function to "ind last employee no "rom 45T1&67.dat data "ile

    int details::last;emp;no)void-

    O"stream "ile>

    "ile.open)45T1&67.dat ios::in->

    "ile.seek%)0 ios::be%->

    int count Q 0>

    // 7earches the last record no in "ile

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    28/60

    while )"ile.read))char -this si(eo")details---

    count Q emp;no>

    "ile.close)->

    return count>

    P

    // Function to append record into 45T1&67.dat data "ilevoid details::583;1335N4)int t;emp;no char t;name?@0A char t;address?@0A int tdd

    int tmm int tyy char t;city?0A char t;state?@A char t;(ip?0A-

    O

    emp;no Q t;emp;no>strcpy)name t;name->

    strcpy)address t;address->

    dd Q tdd>

    mm Q tmm>yy Q tyy>

    strcpy)city t;city->strcpy)state t;state->

    strcpy)(ip t;(ip->

    // 1ppend the record into "ile

    "stream "ile>

    "ile.open)45T1&67.dat ios::out[ios::app->

    "ile.write))char -this si(eo")details-->"ile.close)->

    P

    // Function to delete a selected record "rom 45T1&67.dat data "ile

    void details::delete;employee)int t;emp;no-

    O"stream "ile>

    "ile.open)45T1&67.dat ios::in->

    "stream temp>

    temp.open)T583.dat ios::out->"ile.seek%)0ios::be%->

    // 4elete the record usin% copy method into temporaty "ilewhile )I"ile.eo")--

    O

    "ile.read))char -this si(eo")details-->i" )"ile.eo")--

    break>

    i" )emp;no IQ t;emp;no-

    temp.write))char -this si(eo")details-->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    29/60

    P

    "ile.close)->

    temp.close)->"ile.open)45T1&67.dat ios::out->

    temp.open)T583.dat ios::in->

    temp.seek%)0 ios::be%->

    // 2verwrites the temporay contents into ori%inal 45T1&67.dat data "ile

    while )Itemp.eo")--O

    temp.read))char -this si(eo")details-->

    i" )temp.eo")--

    break>i" )emp;no IQ t;emp;no-

    "ile.write))char -this si(eo")details-->

    P

    "ile.close)->temp.close)->

    P

    // Function to append a record into 583.dat data "ile

    void employee::583;1335N4)int t;emp;no int d int m int y char t;%rade?BAchar t;emp;!ob?BA "loat t;salary int t;deptno-

    O

    emp;no Q t;emp;no>

    dd Q d>mm Q m>

    yy Q y>

    strcpy)%rade t;%rade->strcpy)emp;!ob t;emp;!ob->

    salary Q t;salary>

    deptno Q t;deptno>

    "stream s"ile>

    // 1ppend the new record into 583.dat data "iles"ile.open)583.dat ios::out[ios::app->

    s"ile.write))char -this si(eo")employee-->

    s"ile.close)->P

    // Function to delete a selected record "rom 583.dat data "ilevoid employee::delete;employee)int t;emp;no-

    O

    "stream "ile>

    "ile.open)583.dat ios::in->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    30/60

    "stream temp>

    temp.open)T583.dat ios::out->

    "ile.seek%)0 ios::be%->

    // 4elete the record usin% copy method into temporaty "ile

    while )I"ile.eo")--O

    "ile.read))char -this si(eo")employee-->

    i" )"ile.eo")--break>

    i" )emp;no IQ t;emp;no-

    temp.write))char -this si(eo")employee-->

    P"ile.close)->

    temp.close)->

    "ile.open)583.dat ios::out->

    temp.open)T583.dat ios::in->temp.seek%)0 ios::be%->

    // 2verwrites the temporay contents into ori%inal 583.dat data "ile

    while )Itemp.eo")--

    Otemp.read))char -this si(eo")employee-->

    i" )temp.eo")--

    break>

    i" )emp;no IQ t;emp;no-"ile.write))char -this si(eo")employee-->

    P

    "ile.close)->temp.close)->

    P

    // Function to "ind the basic salary o" an employee "rom 583.dat "or display;emp;list)-

    "unction

    "loat employee::"ound;salary)int t;emp;no-

    O"loat t;salary Q 0.0>

    int 'emp;no>

    "stream s"ile>s"ile.open)583.dat ios::in->

    s"ile.seek%)0 ios::be%->

    // 7earches the record in 583.dat data "ile

    while )s"ile.read))char -this si(eo")employee---

    O

    'emp;no Q emp;no>

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    31/60

    i" )'emp;no QQ t;emp;no-

    O

    t;salary Q salary>break>

    P

    Ps"ile.close)->

    return )t;salary->

    P

    // Function to "ind the desi%nation o" an employee "rom 583.dat "or display;emp;list)-

    "unctionchar employee::"ound;!ob)int t;emp;no-

    O

    char t;emp;!ob?BA>

    int 'emp;no>"stream s"ile>

    s"ile.open)583.dat ios::in->s"ile.seek%)0 ios::be%->

    // 7earches the emp;!ob in 583.dat data "ilewhile )s"ile.read))char -this si(eo")employee---

    O

    'emp;no Q emp;no>

    i" )'emp;no QQ t;emp;no-O

    strcpy)t;emp;!ob emp;!ob->

    break>P

    P

    s"ile.close)->return )t;emp;!ob->

    P

    // Function to chan%e the employee salary either to increase or decrease accoudin% toemp;no

    void employee::chan%e;salary)void-

    Oclrscr)->

    char t;acc?0A>

    int t t;emp;no !>char t;%rade?BA t;emp;!ob?BA>

    int d m y>

    "loat t;salary Q 0.0 ';salary>

    int t;deptno>

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    32/60

    %oto'y)K ->

    cout MM M0Q5'it>%oto'y)->

    cout MM 5nter the employee no. >

    %ets)t;acc->t Q atoi)t;acc->

    t;emp;no Q t>

    i" )t;emp;no QQ 0-return>

    clrscr)->

    details 583;144>

    i" )I583;144."ound;employee)t;emp;no--O

    %oto'y) ->

    cout MM XK5mployee not "ound>

    %etch)->return>

    P%oto'y)K ->

    cout MM M0Q5'it>

    te'tback%round)DH&T5->%oto'y)@ @->

    "or )! Q > !MQ KG> !$$-

    cprint") ->

    te'tback%round)61CW->

    te'tcolor)61CW$6&NW->

    te'tback%round)DH&T5->%oto'y)@0 @->

    cprint")7alary Chan%e 7creen->

    // Chan%e to normal colour mode

    te'tcolor)6&UHTUR1+->

    te'tback%round)61CW->

    "stream s"ile>s"ile.open)583.dat ios::in->

    s"ile.seek%)0 ios::be%->

    // Chan%es the salary and modi"y the details in 583.dat data "ile

    while )s"ile.read))char -this si(eo")employee---

    Oi" )t;emp;no QQ emp;no-

    O

    strcpy)t;%rade %rade->

    strcpy)t;emp;!ob emp;!ob->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    33/60

    d Q dd>

    m Q mm>

    y Q yy>t;salary Q salary>

    t;deptno Q deptno>

    %oto'y)@0 0->cout MM 4esi%nation : >

    puts)t;emp;!ob->

    %oto'y)@0 B->cout MM Zoinin% 4ate : >

    %oto'y)SJ B->

    cout MM d MM

    cout MM asic 7alary R7. MM setw)-

    MM setprecision)B-MM setios"la%s)ios::le"t-

    MM setios"la%s)ios::showpoint-MM setios"la%s)ios::"i'ed-

    MM t;salary>

    %oto'y)@0 ->cout MM Urade : MM %rade>

    %oto'y)@0 B0->

    cout MM 5nter New 7alary : >

    cin ';salary>break>

    P

    Ps"ile.close)->

    i" )';salary Q B00 == ';salary MQ @000-O

    t;salary Q ';salary>

    strcpy)t;%rade C->

    Pelse

    i" )';salary Q @00 == ';salary MQ S000-

    Ot;salary Q ';salary>

    strcpy)t;%rade ->

    Pelse

    i" )';salary Q S00 == ';salary MQ 000-

    O

    t;salary Q ';salary>

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    34/60

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    35/60

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    36/60

    // Calls to print the employee salary

    ';salary Q a."ound;salary)memp;no->

    i" )';salary 0-O

    %oto'y)K0 row->

    cout MM setw)-MM setprecision)B-

    MM setios"la%s)ios::le"t-

    MM setios"la%s)ios::showpoint-MM setios"la%s)ios::"i'ed-

    MM ';salary>

    P

    row$$>i" )row QQ B@-

    O

    "la% Q >

    row Q G>%oto'y)S BS->

    cout MM 3ress any key to continue.... >%etch)->

    clrscr)->

    PP

    %oto'y) row->

    "or )! Q > ! MQ KJ> !$$-

    cout MM Q>"ile.close)->

    i" )I"la%-

    O%oto'y)B BS->

    cout MM 3ress any key to continue...>

    %etch)->P

    %etch)->

    P

    // Function to clear a row "rom le"t o" the screenvoid employee::6e"t;clear)int col int row-

    O

    "or )int ! Q col> ! MQ @J> !$$-O

    %oto'y)! row->

    cout MM >P

    P

    // Function to clear a row "rom ri%ht o" the screen

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    37/60

    void employee::Ri%ht;clear)int col int row-

    O

    "or )int ! Q col> ! MQ KJ> !$$-O

    %oto'y)! row->

    cout MM >P

    P

    // Function to search a record "ound in 45T1&67.dat data "ile

    int details::"ound;employee)int t;emp;no-

    O

    "stream "ile>"ile.open)45T1&67.dat ios::in->

    "ile.seek%)0 ios::be%->

    int "ound Q 0>

    // Checks the employee is their in 45T1&67.dat data "ile or not

    while )"ile.read))char -this si(eo")details---O

    i" )emp;no QQ t;emp;no-

    O"ound Q >

    break>

    P

    P"ile.close)->

    return "ound>

    P

    // Function "or returnin% the name o" employee "rom 45T1&67.dat data "ile

    char details::return;name)int t;emp;no-O

    "stream "ile>

    "ile.open)45T1&67.dat ios::in->

    "ile.seek%)0 ios::be%->char t;name?@0A>

    // Returns the name o" employee "rom 45T1&67.dat data "ilewhile )"ile.read))char -this si(eo")details---

    O

    i" )emp;no QQ t;emp;no-O

    strcpy)t;name name->

    break>

    P

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    38/60

    P

    "ile.close)->

    return t;name>P

    // Function "or returnin% the address o" employee "rom 45T1&67.dat data "ilechar details::return;address)int t;emp;no-

    O

    "stream "ile>"ile.open)45T1&67.dat ios::in->

    "ile.seek%)0 ios::be%->

    char t;address?@0A>

    // Returns the employee address

    while )"ile.read))char -this si(eo")details---

    O

    i" )emp;no QQ t;emp;no-O

    strcpy)t;address address->break>

    P

    P"ile.close)->

    return t;address>

    P

    // Function "or displayin% name and address details "rom 45T1&67.dat data "ile

    void details::display;"rom;details)int t;emp;no-

    O"stream "ile>

    "ile.open)45T1&67.dat ios::in->

    "ile.seek%)0 ios::be%->char t;(ip?0A>

    while )"ile.read))char -this si(eo")details---

    O

    i" )emp;no QQ t;emp;no-O

    %oto'y)0 ->

    cout MM Name : MM name>%oto'y)0 0->

    cout MM 1ddress : MM address>

    %oto'y)0 B->cout MM 4ate o" irth : MM dd MM

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    39/60

    cout MM 7tate : MM state>

    %oto'y)0 ->

    cout MM ,ip Code : MM (ip>break>

    P

    P"ile.close)->

    P

    // Function "or displayin% data "rom 45T1&67.dat data "ile

    void employee::bo';"or;display)int t;emp;no-

    O

    int d m y>struct date d>

    %etdate)=d->

    d Q d.da;day>

    m Q d.da;mon>y Q d.da;year>

    %oto'y)0 G->

    cout MM 5mployee No. MM t;emp;no>

    %oto'y) G->

    cout MM 4ate: MM d MM / MM m MM / MM y>

    %oto'y) K->"or )int i Q > i MQGS> i$$-

    cout MM Q>

    details 583;144>583;144.display;"rom;details)t;emp;no->

    P

    // Function "or displayin% details "rom 583.dat data "ile

    void employee::display;employee)void-

    O

    clrscr)->char t;acc?0A>

    int !>

    int t t;emp;no>%oto'y)K ->

    cout MM M0Q5'it>

    %oto'y) ->cout MM 5nter employee no. >

    %ets)t;acc->

    t Q atoi)t;acc->

    t;emp;no Q t>

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    40/60

    i" )t;emp;no QQ 0-

    return>

    clrscr)->details 583;144>

    i" )I583;144."ound;employee)t;emp;no--

    O %oto'y) ->

    cout MM XKemployee not "ound>

    %etch)->return>

    P

    %oto'y)@0 S->cout MM &ndividual 5mployee>

    %oto'y)@0 ->

    cout MM QQQQQQQQQQQQQQQQQQQ>

    bo';"or;display)t;emp;no->

    "stream "ile>

    "ile.open)583.dat ios::in->

    // 4isplays the employee salary and desi%nation details

    while )"ile.read))char -this si(eo")employee---

    O

    i" )emp;no QQ t;emp;no-O

    %oto'y)S0 ->

    cout MM 4esi%nation : MM emp;!ob>%oto'y)S0 0->

    cout MM 4ate o" Zoinin% : MM dd MM

    %oto'y)S0 S->

    cout MM 4epartment No. : MM deptno>

    %oto'y)S0 G->cout MM Urade : MM %rade>

    delay)B->

    break>

    P

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    41/60

    P

    "ile.close)->

    %oto'y) J->"or )int i Q > i MQGS> i$$-

    cout MM Q>

    %oto'y)B B0->cout MM 3ress any key to Continue ...>

    %etch)->

    P

    / The accounts department %ives salary to each individuals on every month by certain

    conditions. 1ll the terms and conditions are assumed percenta%es and values. ut it

    may di""erent "rom company to company. The employees are bene"ited certain earnin%sand deductions as:

    5arnin%s:

    41 < 4earness 1llowanceHR1 < House Rent 1llowance

    C2NE1 < Conveyance 1llowance.

    4eductions:

    3F < 3rovident Fund5.7.& < 5mployee 7tate &nsurance

    &T1* < &ncome Ta'

    C7F < Canteen F1cility. For each cate%ory o" employee the cantee char%e is Rs.

    @0/

    clrscr)->

    details 583;144>i" )I583;144."ound;employee)t;emp;no--

    O

    %oto'y) ->

    cout MM XKemployee not "ound>%etch)->

    return>

    P%oto'y)@0 @->

    cout MM 7alary 7lip>

    %oto'y)@0 S->cout MM QQQQQQQQQQQ>

    int d m y>

    struct date d>

    %etdate)=d->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    43/60

    d Q d.da;day>

    m Q d.da;mon>

    y Q d.da;year>%oto'y)0 ->

    cout MM 5mployee No. MM t;emp;no>

    // To print the month in character "orm

    switch )m-

    O // %et month namecase : strcpy) cmonth Zanuary -> break>

    case B : strcpy) cmonth February -> break>

    case @ : strcpy) cmonth 8arch -> break>

    case S : strcpy) cmonth 1pril -> break>case : strcpy) cmonth 8ay -> break>

    case G : strcpy) cmonth Zune -> break>

    case K : strcpy) cmonth Zuly -> break>

    case : strcpy) cmonth 1u%ust -> break>case J : strcpy) cmonth 7eptember-> break>

    case 0 : strcpy) cmonth 2ctober -> break>case : strcpy) cmonth November-> break>

    case B : strcpy) cmonth 4ecember -> break>

    P%oto'y)S ->

    cout MM cmonth>

    %oto'y) ->cout MM 4ate: MM d MM / MM m MM / MM y>

    %oto'y) G->

    "or )int i Q 0> i MQ GS> i$$-cout MM Q>

    // 4isplays the name and address part o" the employee583;144.send;41T1)t;emp;no->

    "stream "ile>

    "ile.open)583.dat ios::in->

    // 4isplay the desi%nation and salary part o" the employee

    while )"ile.read))char -this si(eo")employee---O

    i" )emp;no QQ t;emp;no-

    O%oto'y)S ->

    cout MM 4ate o" Zoinin% : MM dd MM

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    44/60

    %oto'y)S 0->

    cout MM 4epartment No. : MM deptno>

    %oto'y)S ->cout MM Urade : MM %rade>

    delay)B->

    break>P

    P

    "ile.close)->

    %oto'y) B->

    "or )i Q 0> i MQ GS> i$$-

    cout MM %oto'y)0 @->

    cout MM 7alary>

    %oto'y)@ @->

    cout MM 5arnin%s>%oto'y)GB @->

    cout MM 4eduction>%oto'y) S->

    "or )i Q 0> i MQ GS> i$$-

    cout MM

    // 7teps to calculate the da hra p" esi convayence etc.

    "loat 53F Q 0.0> // 5mployee provident "und )deduction-

    "loat 41 Q 0.0> // 5mployee 4earness allowance )earnin%s-"loat 57& Q 0.0> // 5mployee state insurance )deduction-

    "loat HR1 Q 0.0> // 5mployee house rent allowance )earnin%s-

    "loat C1NT55N Q 0.0> // 5mployee canteen "acility )deduction-"loat C2NE Q 0.0> // 5mployee conveyance )earnin%s-

    "loat 1NN;UR277 Q 0.0> // 5mployee annual income

    "loat &T1* Q 0.0> // 5mployee income ta'"loat N5T;&NC285 Q 0.0> // 5mployee monthly income

    "loat T2T16;51RN Q 0.0> // 5mployee total earnin%s

    "loat T2T16;454 Q 0.0> // 5mployee total deductions

    "loat 3FT1* Q 0.0> // 3rovident "und ta'"loat T1*165 Q 0.0> // 5mployee ta'able amount

    // 7teps the calculate 41 HR1 and C2NE accourdin% the table o" abovedescription

    i" )salary Q B00 == salary MQ @000-

    O41 Q salary 0.J>

    HR1 Q salary 0.B>

    C2NE Q salary 0.>

    P

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    45/60

    else

    i" )salary Q @00 == salary MQ S000-

    O41 Q salary 0.B>

    HR1 Q salary 0.@>

    C2NE Q salary 0.>P

    else

    i" )salary Q S00 == salary MQ 000-O

    41 Q salary 0.S>

    HR1 Q salary 0.@>

    C2NE Q salary 0.B>P

    else

    i" )salary Q 00-

    O 41 Q salary 0.G>

    HR1 Q salary 0.S>C2NE Q salary 0.B>

    P

    T2T16;51RN Q salary $ 41 $ HR1 $ C2NE> // Calculates the total monthly%ross

    1NN;UR277 Q T2T16;51RN B> // 1nnual %ross

    // Calculation part "or deduction as p" )B\- esi ).K\- cs" )Rs. @0/ // Calculates B\ as provident "und

    // Calculates 0.K\ as employee state insurance

    57& Q salary 0.0K>C1NT55N Q @0> // Canteen char%e

    // Note: 1s the employeer provides B\ as 3F 0\ is e'empted and// remainin% B\ is ta'able.

    // 1nnually ta'able "rom 3" side

    3FT1* Q ))salary $ 41- 0.B- B>

    // 1nnual %ross includin% 3rovident Fund ta'

    1NN;UR277 Q 1NN;UR277 $ 3FT1*>

    // Ta' calculation steps

    // 1"ter less standard deduction the annual %ross is:

    i" )1NN;UR277 MQ G0000-1NN;UR277 Q S0000 < B0000>

    else

    1NN;UR277 Q 1NN;UR277 < B0000>

    // Calculation o" ta'able amount

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    46/60

    i" )1NN;UR277 S0000-

    T1*165 Q 1NN;UR277 < S0000>

    elseT1*165 Q 0>

    // 7teps to calculate the ta'i" )T1*165 MQ B0000-

    &T1* Q T1*165 0.>

    elsei" )T1*165 B0000 == T1*165 MQ 0000-

    &T1* Q B000 $ ))T1*165

    else

    i" )T1*165 0000-&T1* Q B0000 $ ))T1*165

    &T1* Q &T1* / B>

    // The total deductionT2T16;454 Q 53F $ 57& $ C1NT55N $ &T1*>

    N5T;&NC285 Q T2T16;51RN < T2T16;454>

    %oto'y) ->cout MM asic: >

    %oto'y)BB ->

    cout MM setw)-

    MM setprecision)B-MM setios"la%s)ios::le"t-

    MM setios"la%s)ios::showpoint-

    MM setios"la%s)ios::"i'ed-MM salary>

    %oto'y)@ ->cout MM setw)-

    MM setprecision)B-

    MM setios"la%s)ios::le"t-

    MM setios"la%s)ios::showpoint-MM setios"la%s)ios::"i'ed-

    MM salary>

    %oto'y)0 ->

    cout MM 5.3.F.: >

    %oto'y)G@ ->cout MM setw)-

    MM setprecision)B-

    MM setios"la%s)ios::le"t-

    MM setios"la%s)ios::showpoint-

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    47/60

    MM setios"la%s)ios::"i'ed-

    MM 53F >

    %oto'y) G->

    cout MM 4.1.: >

    %oto'y)BB G->cout MM setw)-

    MM setprecision)B-

    MM setios"la%s)ios::le"t-MM setios"la%s)ios::showpoint-

    MM setios"la%s)ios::"i'ed-

    MM 41>

    %oto'y)@ G->

    cout MM setw)-

    MM setprecision)B-

    MM setios"la%s)ios::le"t-MM setios"la%s)ios::showpoint-

    MM setios"la%s)ios::"i'ed-MM 41>

    %oto'y)0 G->cout MM 5.7.&.:>

    %oto'y)G@ G->

    cout MM setw)-

    MM setprecision)B-MM setios"la%s)ios::le"t-

    MM setios"la%s)ios::showpoint-

    MM setios"la%s)ios::"i'ed-MM 57&>

    %oto'y) K->cout MM H.R.1.: >

    %oto'y)BB K->

    cout MM setw)-

    MM setprecision)B-MM setios"la%s)ios::le"t-

    MM setios"la%s)ios::showpoint-

    MM setios"la%s)ios::"i'ed-MM HR1>

    %oto'y)@ K->cout MM setw)-

    MM setprecision)B-

    MM setios"la%s)ios::le"t-

    MM setios"la%s)ios::showpoint-

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    48/60

    MM setios"la%s)ios::"i'ed-

    MM HR1>

    %oto'y)0 K->

    cout MM C1NT55N: >

    %oto'y)G@ K->cout MM setw)-

    MM setprecision)B-

    MM setios"la%s)ios::le"t-MM setios"la%s)ios::showpoint-

    MM setios"la%s)ios::"i'ed-

    MM C1NT55N >

    %oto'y) ->

    cout MM C2NE.: >

    %oto'y)BB ->

    cout MM setw)-MM setprecision)B-

    MM setios"la%s)ios::le"t-MM setios"la%s)ios::showpoint-

    MM setios"la%s)ios::"i'ed-

    MM C2NE>

    %oto'y)@ ->

    cout MM setw)-

    MM setprecision)B-MM setios"la%s)ios::le"t-

    MM setios"la%s)ios::showpoint-

    MM setios"la%s)ios::"i'ed-MM C2NE>

    %oto'y)0 ->cout MM &NC285 T1*: >

    %oto'y)G@ ->

    cout MM setw)-

    MM setprecision)B-MM setios"la%s)ios::le"t-

    MM setios"la%s)ios::showpoint-

    MM setios"la%s)ios::"i'ed-MM &T1* >

    %oto'y) J->"or )i Q 0> i MQ GS> i$$-

    cout MM

    %oto'y) B0->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    49/60

    cout MM Total 5arnin%s: >

    %oto'y)@S B0->

    cout MM setw)-MM setprecision)B-

    MM setios"la%s)ios::le"t-

    MM setios"la%s)ios::showpoint-MM setios"la%s)ios::"i'ed-

    MM T2T16;51RN>

    %oto'y)S B0->

    cout MM Total 4educt: >

    %oto'y)G@ B0->

    cout MM setw)-MM setprecision)B-

    MM setios"la%s)ios::le"t-

    MM setios"la%s)ios::showpoint-

    MM setios"la%s)ios::"i'ed-MM T2T16;454>

    %oto'y) B->

    "or )i Q 0> i MQ GS> i$$-

    cout MM Q>

    %oto'y) BB->

    cout MM Net 3ay: >

    %oto'y)@S BB->cout MM setw)-

    MM setprecision)B-

    MM setios"la%s)ios::le"t-MM setios"la%s)ios::showpoint-

    MM setios"la%s)ios::"i'ed-

    MM N5T;&NC285>

    %oto'y) B@->

    cout MM 7i%nature>

    %oto'y)0 BS->

    cout MM 3ress any key to Continue ...>

    %etch)->P

    // Function to provide data into salary reportvoid details::send;41T1)int t;emp;no-

    O

    "stream "ile>

    "ile.open)45T1&67.dat ios::in->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    50/60

    "ile.seek%)0 ios::be%->

    char t;(ip?0A>

    // 7endin% the data into month;salary "unction

    while )"ile.read))char -this si(eo")details---

    O i" )emp;no QQ t;emp;no-

    O

    %oto'y)0 K->cout MM Name : MM name>

    %oto'y)0 ->

    cout MM 1ddress : MM address>

    %oto'y)0 J->cout MM City : MM city>

    %oto'y)0 0->

    cout MM 7tate : MM state>

    %oto'y)0 ->cout MM ,ip Code : MM (ip>

    %oto'y)S K->cout MM 4ate o" irth : MM dd MM

    PP

    "ile.close)->

    P

    // Function "or main menu to append new record into both 45T1&67.dat and 583.dat

    data "iles.void employee::new;employee)void-

    O

    char ch>int i valid>

    clrscr)->

    details 583;144>

    %oto'y)G S->cout MM M0Q5'it>

    %oto'y)@@->"or )i Q > iMQ KG> i$$-

    cprint") ->

    te'tback%round)61CW->

    te'tcolor)61CW$6&NW->

    te'tback%round)DH&T5->

    %oto'y)@0 S->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    51/60

    cprint")2pen New 5mployee->

    te'tcolor)6&UHTUR1+->

    te'tback%round)61CW->int d m y>

    struct date d> // For e'tractin% system date

    %etdate)=d->d Q d.da;day>

    m Q d.da;mon>

    y Q d.da;year>

    int t;emp;no>

    t;emp;no Q 583;144.last;emp;no)->

    t;emp;no$$>

    i" )t;emp;no QQ -

    O

    583;144.583;1335N4)t;emp;no abc 'y( 0 0 0 aaa aaaaa->

    583;144.delete;employee)t;emp;no->583;1335N4)t;emp;no JJK 4 details . 0->

    delete;employee)t;emp;no->

    P

    char t;name?@0A t;address?@0A>

    char t;%rade?BA t;emp;!ob?BA>

    int tdd tmm tyy>char 3;city?0A t;state?@A t;(ip?0A>

    "loat t;salary Q 0.0>

    int t;deptno>%oto'y) G->

    cout MM 4ate: MM d MM #cout MM Name : >

    %oto'y) 0->

    cout MM 1ddress : >%oto'y) B->

    cout MM 4ate o" irth : >

    %oto'y) @->cout MM City : >

    %oto'y) S->

    cout MM 7tate : >

    %oto'y) ->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    52/60

    cout MM ,ip : >

    %oto'y)S0 ->

    cout MM 4esi%nation : >%oto'y)S0 G->

    cout MM 4ate o" Zoinin% : >

    %oto'y)S0 K->cout MM 4epartment no. : >

    %oto'y)S0 ->

    cout MM asic 7alary >%oto'y)S0 J->

    cout MM Urade : >

    doO

    Ri%ht;clear)S ->

    6e"t;clear) B@->

    %oto'y) B@->cout MM 5nter Name o" the 3erson>

    valid Q >%oto'y)S ->

    %ets)t;name->

    strupr)t;name->i" )t;name?0A QQ #0#-

    return>

    i" )strlen)t;name- QQ 0 [[ strlen)t;name- B-

    Ovalid Q 0>

    %oto'y) B@->

    cprint")XKName should not %reater than B->%etch)->

    P

    P while )Ivalid->

    do

    O

    6e"t;clear)B0 0->6e"t;clear) B@->

    %oto'y) B@->

    cout MM 5nter 1ddress o" the 3erson >valid Q >

    %oto'y)B0 0->

    %ets)t;address->strupr)t;address->

    i" )t;address?0A QQ #0#-

    return>

    i" )strlen)t;address- QQ 0 [[ strlen)t;address- B-

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    53/60

    O

    valid Q 0>

    %oto'y) B@->cprint")XK1ddress should not %reater than B->

    %etch)->

    PP while )Ivalid->

    6e"t;clear)B@ B->%oto'y)B@ B->

    cin tdd>

    %oto'y)B B->

    cout MM %oto'y)BG B->

    cin tmm>

    %oto'y)B B->

    cout MM %oto'y)BJ B->

    cin tyy>

    do

    O6e"t;clear)@ @->

    6e"t;clear) B@->

    %oto'y) B@->

    cout MM 5nter City >valid Q >

    %oto'y) @->

    %ets)3;city->strupr)3;city->

    i" )3;city?0A QQ #0#-

    return>i" )strlen)3;city- QQ 0 [[ strlen)3;city- 0-

    O

    valid Q 0>

    %oto'y) B@->cprint")XKCity 7hould not space->

    %etch)->

    PP while )Ivalid->

    doO

    6e"t;clear) S->

    6e"t;clear) B@->

    %oto'y) B@->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    54/60

    cout MM 5nter 7tate>

    valid Q >

    %oto'y) S->%ets)t;state->

    strupr)t;state->

    i" )t;state?0A QQ #0#-return>

    i" )strlen)t;state- QQ 0 [[ strlen)t;state- B-

    Ovalid Q 0>

    %oto'y) B@->

    cprint")XK7tate should not %reater than ->

    %etch)->P

    P while )Ivalid->

    doO

    6e"t;clear) ->6e"t;clear) B@->

    %oto'y) B@->

    cout MM 5nter ,ip Code>valid Q >

    %oto'y) ->

    %ets)t;(ip->

    strupr)t;(ip->i" )t;(ip?0A QQ #0#-

    return>

    i" )strlen)t;(ip- QQ 0 [[ strlen)t;(ip- J-O

    valid Q 0>

    %oto'y) B@->cprint")XK,ip should not %reater than J->

    %etch)->

    P

    P while )Ivalid->

    do

    ORi%ht;clear)J ->

    6e"t;clear) B@->

    %oto'y) B@->cout MM 5nter 4esi%nation>

    valid Q >

    %oto'y)J ->

    %ets)t;emp;!ob->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    55/60

    strupr)t;emp;!ob->

    i" )t;emp;!ob?0A QQ #0#-

    return>i" )strlen)t;emp;!ob- QQ 0 [[ strlen)t;emp;!ob- -

    O

    valid Q 0>%oto'y) B@->

    cprint")XK4esi%nation should not %reater than J->

    %etch)->P

    P while )Ivalid->

    Ri%ht;clear)J G->

    %oto'y)J G->

    cin d>

    %oto'y)G G->

    cout MM %oto'y)GB G->

    cin m>%oto'y)GS G->

    cout MM

    %oto'y)G G->cin y>

    %oto'y)J K->

    cin t;deptno>

    do

    O

    Ri%ht;clear)J ->6e"t;clear) B@->

    %oto'y) B@->

    cout MM asic 7alary not less that J00>valid Q >

    char t?0A> // 4eclare as character type and will convert into "loat type

    usin% ato")- "unction

    %oto'y)J ->%ets)t->

    t;salary Q ato")t->

    i" )t?0A QQ #0#-O

    valid Q 0>

    %oto'y) B@->cprint")XK7hould not less than J00->

    %etch)->

    P

    P while )Ivalid->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    56/60

    i" )t;salary Q B00 == t;salary MQ @000-

    Ostrcpy)t;%rade C->

    P

    else i" )t;salary Q @00 == t;salary MQ S000-

    O

    strcpy)t;%rade ->P

    else

    i" )t;salary Q S00 == t;salary MQ 000-

    Ostrcpy)t;%rade 1->

    P

    else

    i" )t;salary 000-O

    strcpy)t;%rade 2->P

    else

    return>

    %oto'y)J J->

    cout MM t;%rade>

    6e"t;clear) B@->

    do

    O6e"t;clear) K->

    valid Q >

    %oto'y) BB->cout MM 4o you want to save the record M+/N: >

    ch Q %etche)->

    i" )ch QQ #0#-

    return>ch Q toupper)ch->

    P while )ch IQ #N# == ch IQ #+#->

    i" )ch QQ #N#-return>

    clrscr)->

    // 1ppends the new employee record into 45T1&67.dat data "ile

    583;144.583;1335N4)t;emp;no t;name t;address tdd tmm tyy 3;city

    t;state t;(ip->

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    57/60

    // 1ppends the new employee salary and desi%nation into 583.dat data "ile

    583;1335N4)t;emp;no d m y t;%rade t;emp;!ob t;salary t;deptno->

    P

    // Function to count the total number o" records in 45T1&67.dat data "ile "or %eneratin%

    automatic employee numberint details::recordno)int t;emp;no-

    O

    "stream "ile>"ile.open)45T1&67.dat ios::in->

    "ile.seek%)0 ios::be%->

    int count Q 0>

    // Counts the total records in 45T1&67.dat data "ile

    while )"ile.read))char -this si(eo")details---

    O

    count$$>i" )t;emp;no QQ emp;no-

    break>P

    "ile.close)->

    return count>P

    // Function to count the total number o" records in 583.dat data "ile "or %eneratin%

    automatic employee numberint employee::recordno)int t;emp;no-

    O

    "stream s"ile>s"ile.open)583.dat ios::in->

    s"ile.seek%)0 ios::be%->

    int count Q 0>

    // Counts the total record in 583.dat data "ile

    while )s"ile.read))char -this si(eo")employee---

    Ocount$$>

    i" )t;emp;no QQ emp;no-

    break>P

    s"ile.close)->

    return count>

    P

    // Function to close the employee account in or%ani(ation.

    void employee::close;employee)void-

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    58/60

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    59/60

    cout MM Urade : MM %rade>

    delay)B->

    break>P

    P

    "ile.close)->%oto'y) J->

    "or )int i Q > i MQGS> i$$-

    cout MM Q>%oto'y)0 B0->

    do

    O6e"t;clear) ->

    %oto'y) B0->

    cout MM Close this employee My/nYY >

    ch Q %etche)->i" )ch QQ #0#-

    return>ch Q toupper)ch->

    Pwhile )ch IQ #N# == ch IQ #+#->

    i" )ch QQ #N#-return>

    // Function to delete the record "rom 45T1&67.dat data "ile

    583;144.delete;employee)t;emp;no->

    // Function to delete the record "rom 583.dat data "ile

    delete;employee)t;emp;no->%oto'y) B0->

    cout MM XKemployee 4eleted>

    %oto'y) B@->cout MM 3ress any key to continue...>

    %etch)->

    P

    // 8ain 3ro%ram starts at here

    void main)void-

    Ocontrol c>

    // Callin% "unction "rom UH.C33 "ile

    &NTR2)->close%raph)->

    c.help)->

    c.81&N;7CR55N)->

    P

  • 8/10/2019 wtwtwCreate a document containing text that should be properly aligned. Use the replace all option to replace ea

    60/60