Computer Application Project
Computer Application Project
2023-2024
if (!found) {
System.out.println("No employees aged between 50 and 60
found.");
}
}
public static void printEmployeesAboveSalary() {
Scanner obj=new Scanner(System.in);
System.out.println("Enter the minimum salary: ");
double minSalary=obj.nextDouble();
System.out.println("Employees earning above " + minSalary + ":");
boolean found=false; // A flag to check if any employees were
found above the specified salary
for (int i = 0; i < numEmployees; i++) {
if (empBasicPay[i] > minSalary) {
System.out.println("Employee ID: " + empId[i]);
System.out.println("Employee Name: " + empName[i]);
System.out.println("Employee Designation: " +
empDesignation[i]);
System.out.println("Employee Age: " + empAge[i]);
System.out.println("Employee Basic Pay: " + empBasicPay[i]);
System.out.println();
found = true; // Set the flag to true when an employee is
found above the specified salary
}
}
if (!found) {
System.out.println("No employees earning above " + minSalary +
" found.");
}
}
da double Calculating DA
grossPay double Calculating gross pay
pf double Calculating PF
tax double Calculating Tax
deduction
totalDeductions Double Calculating total
deductions (PF+ Tax)
netPay double Calculating net pay
(gross pay- total
deductions)
a int Used in the formal
parameter for
acceptEmployeeDetails
method