#include<fstream>
#include<conio.h>
#include<stdio.h>
struct emp
{
int id;
int age;
char name;
char address;
char garde;
float sal;
};
void meun(void)
int great(void)
int main( )
newe.open("newwmp.txt");
char name[22];
string ab;
int num b=0,min,id,age,garde,sal;
while(!newe.eof())
{
newe>>id>>name>>age>>garde>>sal>>ab;
numb++;
}
numb--;
n=numb;
if(numb>15)
{
min=numb-15
printf("")
return 0;
}
newe.close();
meun();
printf("choose the option");
scanf("a");
if(a=='b'||a=='B')
{
{
system("cls");
char b;
printf("Maximum entires are 15 ");
printf("Enter the number of entries you want ");
g:
scanf("n");
if(n>15)
{
system("cls");
printf("You cross the maximum range of entires");
printf("Enter the entires again that will be less than 15");
goto g;
}
system("cls");
newe.open("newemp.txt");
for(int i=0;i<n;i++)
{
printf(" Enter the details of employee:");
printf("Enter ID");
scanf("%d",a);
printf("Enter age");
scanf("%d",age);
printf("Enter garde");
scanf("%s", garde);
printf("Enter salary");
scanf("%f", sal);
printf("Enter Name");
scanf("%S", name);
printf("Enter Address ");
scanf("%s", address);
system("cls");
printf("Enter ID");
printf("Enter name");
printf("Enter age");
printf("Enter garde");
printf("Enter sal");
printf("Enter address");
}
newemp.close();
ofstreamnewemp;
printf("Do you want to go back to main meun", b);
if(b=='y'|| b=='Y')
{
system("cls");
goto s;
}
else
{
no(b);
return 0;
}
}
}
else if(a=='l'|| a=='L')
{
system("cls");
printf("ID\t,Name\t,age\t,address\t,salary\t,garde\t");
newe.open("newemp.txt");
char name[22];
int num=0;
int ID,age;
string ab;
for(inti=0;i<n;i++)
{
newe>>ID>>name>>garde>>sal>>age>>address;
printf("ID\t,name\t,garde\t,sal\t,age\t,address")
}
newe.close();
printf("Do you want to go back to main meun", b);
if(b=='y'||b=='Y')
{
system("cls");
goto s;
}
else
{
no(b);
return 0;
}
}
void wlcm(void)//welcome screen function
{
for(int i=o;i<175;i++)
{
printf("*");
}
{
void meun(void)
printf("*Employee Management system*");
printf("\n press b......Built the employee table");
printf("\n press l......List the employee table");
print("\n press q......Exit");
}
0 comments:
Post a Comment