Mini Projet
Mini Projet
import java.util.*;
import java.io.*;
class MainMenu
System.out.println("\t\t*******************************************");
System.out.println("\t\t*******************************************");
System.out.println("\t\t\t --------------------");
System.out.println("\t\t\t --------------------");
class Employee_Add
{
public void createFile()
emp.getInfo();
try{
if(f1.createNewFile()){
myWriter.close();
sc.nextLine();
else {
sc.nextLine();
catch(Exception e){System.out.println(e);}
}
/************************* Taking Employee Details ************************/
class EmployDetail
String name;
String father_name;
String email;
String position;
String employ_id;
String employ_salary;
String employ_contact;
name=sc.nextLine();
father_name=sc.nextLine();
employ_id=sc.nextLine();
email=sc.nextLine();
position=sc.nextLine();
employ_contact=sc.nextLine();
employ_salary=sc.nextLine();
}
/************************ To Show details of Employee *********************/
class Employee_Show
while (sc.hasNextLine())
System.out.println(sc.nextLine());
class Employee_Remove
if(file.exists())
if(file.delete());
}
else
class Employee_Update
String fileContext="";
while (sc.hasNextLine())
fileContext =fileContext+"\n"+sc.nextLine();
fileContext = fileContext.replaceAll(o,n);
myWriter.write(fileContext);
myWriter.close();
System.out.println("\n*****************************************");
System.out.println("*****************************************");
System.exit(0);
class EmployManagementSystem
System.out.print("\033[H\033[2J");
int i=0;
obj1.menu();
i=Integer.parseInt(sc.nextLine());
switch(i)
case 1:
/** Creating class's object and calling Function using that object **/
ep.createFile();
System.out.print("\033[H\033[2J");
obj1.menu();
break;
case 2:
String s=sc.nextLine();
try
epv.viewFile(s);}
catch(Exception e){System.out.println(e);}
sc.nextLine();
System.out.print("\033[H\033[2J");
obj1.menu();
break;
case 3:
String s=sc.nextLine();
epr.removeFile(s);
sc.nextLine();
System.out.print("\033[H\033[2J");
obj1.menu();
break;
case 4:
String I=sc.nextLine();
try
epv.viewFile(I);
catch(Exception e)
System.out.println(e);
System.out.println("If you want to Change the Name, then Enter Current Name and Press
Enter. Then write the new Name then Press Enter. It will Update the Name.\n");
String s=sc.nextLine();
String n=sc.nextLine();
try
epu.updateFile(I,s,n);
sc.nextLine();
System.out.print("\033[H\033[2J");
obj1.menu();
break;
catch(IOException e)
System.out.println(e);
case 5:
obj.out();
}
/****************************** CODED BY ABHINAV DUBEY ************************/