1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144
|
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<process.h>
class employee // structure emp_inf
{
int emp_no,age;
float mon_inc,ann_inc;
char emp_name[100],addr[100],sex,loc[25],post[25];
public:
void display();
void enter();
void search(int ,int);
}info[10]; // array of 10 structures
void employee::display() // DISPLAY DATA ACCORDINGLY
{
cout<<"\n\nemployee no:::::"<<emp_no;
cout<<"\nemployee name:"<<emp_name;
cout<<"\nage:"<<age;
cout<<"\nsex:"<<sex;
cout<<"\nlocation:"<<loc;
cout<<"\nadress:"<<addr;
cout<<"\n\n===========job details==========";
cout<<"\n\npost:"<<post;
cout<<"\nmonthly income:"<<mon_inc;
cout<<"\tannual income:"<<mon_inc*12;
}
void employee::enter()
{
cout<<"\nemployee no:::::";
cin>>emp_no;
cout<<"employee name:";
gets(emp_name);
cout<<"age:";
cin>>age;
cout<<"sex[m/f]:";
cin>>sex;
cout<<"location:";
gets(loc);
cout<<"adress:";
gets(addr);
cout<<"post:";
gets(post);
cout<<"monthly income:";
cin>>mon_inc;
}
void employee::search(int uempno,int &flag)
{
if(emp_no==uempno)
{
display();
flag=1;
break;
}
}
void main()
{
clrscr();
int l=0;
goto cyberdude;
cyberdude:
int uempno,i,j,ch2,eno,flag=0;
char ch1;
clrscr();
cout<<"\n______EMPLOYEE DATA ENTRY ZONE 1.0________\n1.enter employee info \n2.search for employee\n3.credits\n4.exit\nchoice:[1/2/3/4]:";
cin>>ch2;
if(ch2==2)
{
cout<<"enter employee no to be searched for:";
cin>>uempno;
for(j=0;j<=10;++j)
{
info[i].search(uempno,flag);
}
if(flag==0)
cout<<"no such employee exists";
cout<<"\ndo you want to continue:[y/n]:";
cin>>ch1;
if(ch1=='y'||ch1=='Y')
goto cyberdude;
else if(ch1=='n'||ch1=='N')
exit(0);
else
cout<<"\a\ainvalid choice";
}
else if(ch2==1)
{
cout<<"specify the storage space :";
cin>>eno;
if(eno>10)
{
cout<<"\a\nmaximum available memmory slots are 10 try again";
getch();
exit(0);
}
for(i=l;i<=(eno+l)-1;++i) // TO GET EMPLOYEE INFORMATION
{
cout<<"\n______"<<i+1<<"___________";
info[i].enter();
}
l=i;
goto cyberdude;
}
else if(ch2==4)
exit(0);
else if(ch2==3)
{
cout<<"\n______EMPLOYEE DATA ENTRY ZONE 1.0________"; // CREDITS
cout<<"\n coding by : CYBER DUDE";
cout<<"\n tested by : CYBER DUDE";
cout<<"\n thanks to : dos box ";
cout<<"\n release date : 28/03/2013";
cout<<"\n simulated in windows 7 Ultimate 32 bit system";
cout<<"\n USE DOS BOX FOR FULL SCREEN C++";
cout<<"\n contact me for any c++ code .Really I love coding and that kind of stuffs";
cout<<"\n\a IF U NOTICE ANY ERROR CONTACT ME OR RELEASE CORRECTED VERSIONS
\n\t HAPPY PROGRAMMING\n\t\t***************";
getch();
goto cyberdude;
}
else
cout<<"\n\a\a\ainvalid choice TERMINATING PROGRAM..........";
getch();
}
// ************************************************************THE END******************************************************************
|