Task#13 Assignment in C++

 #include<iostream>

#include<fstream>

using namespace std;

int main()

{

string Name;string Dept;string Address;string Phone;string ID;int Age;

string str;

ifstream Empin("Emp.txt");

Empin>>ID>>Name>>Address>>Dept>>Phone>>Age;int found=0;

if(Dept=="Adm")

{ ofstream Admout("Adm.txt");

Admout<<ID<<"\t"<<Name<<"\t"<<Address<<"\t"<<Dept<<"\t"<<Phone<<"\t"<<Age; }

else if(Dept=="Pro")

{ ofstream Proout("Adm.txt");

Proout<<ID<<"\t"<<Name<<"\t"<<Address<<"\t"<<Dept<<"\t"<<Phone<<"\t"<<Age; }

else if(Dept=="IT")

{ ofstream ITout("Adm.txt");

ITout<<ID<<"\t"<<Name<<"\t"<<Address<<"\t"<<Dept<<"\t"<<Phone<<"\t"<<Age; }

else if(Dept=="Sal")

{ ofstream Salout("Adm.txt");

Salout<<ID<<"\t"<<Name<<"\t"<<Address<<"\t"<<Dept<<"\t"<<Phone<<"\t"<<Age; }

else cout<<"Out OF Departments";

}

Comments