forked from sainirock61/CPP-Projects-Algos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEMPLOYEE.CPP
More file actions
36 lines (33 loc) · 919 Bytes
/
EMPLOYEE.CPP
File metadata and controls
36 lines (33 loc) · 919 Bytes
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
#include<iostream>
#include "Common.h"
#include<fstream>
#include<cstdlib>
using namespace std;
bool getEmp(ifstream &infil,char a[],char b[],int& c,int& d,int& e,int& f)
{
infil>>a>>b>>c>>d>>e>>f;
if(!infil)
return false;
return true;
}
int main()
{
ifstream employeeData;
employeeData.open("EMPLOYEE.DAT");
if(!employeeData)
{
cerr<<"\aERROR 100 opening EMPLOYEE.DAT";
exit(100);
}
cout<<"\t\t\t *** E M P L O Y E E D A T A ***";
drawline();
char eID[5],name[10];
int basic,hra,da,extra_allowance;
cout<<"\n\tE.ID "<<"\tName"<<"\tBasic"<<"\tHRA"<<"\tDA"<<"\tExtra Allowance\n";
while(getEmp(employeeData,eID,name,basic,hra,da,extra_allowance))
{
cout<<"\t"<<eID<<"\t"<<name<<"\t"<<basic<<"\t"<<hra<<"\t"<<da<<"\t"<<extra_allowance<<"\n";
}
employeeData.close();
return 0;
}