Professional Documents
Culture Documents
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Scanner;
class Employee {
int empId;
String name;
String department;
String position;
Map<String, Integer> attendance; // Store attendance: Date -> Hours
int performanceScore; // Performance evaluation score
public HRManagementSystem() {
this.employees = new ArrayList<>();
this.scanner = new Scanner(System.in);
}
employee.name = name;
employee.department = department;
employee.position = position;
System.out.println("Employee details updated successfully.");
return;
}
}
System.out.println("Employee not found.");
}
// Sample usage
public static void main(String[] args) {
HRManagementSystem hrSystem = new HRManagementSystem();
Scanner scanner = new Scanner(System.in);
char choice;
do {
System.out.println("Select Operation:");
System.out.println("1. Add Employee");
System.out.println("2. Remove Employee");
System.out.println("3. Update Employee Details");
System.out.println("4. Mark Attendance");
System.out.println("5. Evaluate Performance");
System.out.println("6. View Attendance Report");
System.out.println("7. View Performance Report");
System.out.println("8. Display Employees");
System.out.println("9. Go Back");
switch (operation) {
case 1:
hrSystem.addEmployee();
break;
case 2:
System.out.println("Enter Employee ID to Remove:");
int empIdToRemove = scanner.nextInt();
hrSystem.removeEmployee(empIdToRemove);
break;
case 3:
System.out.println("Enter Employee ID to Update:");
int empIdToUpdate = scanner.nextInt();
scanner.nextLine(); // Consume newline
hrSystem.updateEmployee(empIdToUpdate);
break;
case 4:
System.out.println("Enter Employee ID to Mark Attendance:");
int empIdToMarkAttendance = scanner.nextInt();
scanner.nextLine(); // Consume newline
hrSystem.markAttendance(empIdToMarkAttendance);
break;
case 5:
System.out.println("Enter Employee ID to Evaluate Performance:");
int empIdToEvaluatePerformance = scanner.nextInt();
hrSystem.evaluatePerformance(empIdToEvaluatePerformance);
break;
case 6:
System.out.println("Enter Employee ID to View Attendance Report:");
int empIdForAttendanceReport = scanner.nextInt();
hrSystem.displayAttendanceReport(empIdForAttendanceReport);
break;
case 7:
System.out.println("Enter Employee ID to View Performance Report:");
int empIdForPerformanceReport = scanner.nextInt();
hrSystem.displayPerformanceReport(empIdForPerformanceReport);
break;
case 8:
hrSystem.displayEmployees();
break;
case 9:
// Allow HR professional to go back to the main menu
break;
default:
System.out.println("Invalid Operation.");
}