Created
March 5, 2018 06:07
-
-
Save viveknarang/c5f628fbfe6e99d919251038b679622c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void printEmpData(int id) | |
{ | |
boolean exists = false; | |
System.out.println("ID" + " " + "Name" + " " + "Hours" + " " + "Salary"); | |
System.out.println("-------------------------"); | |
for(int i = 0; i < employeePayroll.length; i++) { | |
if (employeePayroll[i].getId() == id) { | |
exists = true; | |
System.out.println(employeePayroll[i].getId() + " " + employeePayroll[i].getName() + " " + employeePayroll[i].getHours() + " " + (employeePayroll[i].getHours() * employeePayroll[i].getRate())); | |
} | |
} | |
if (!exists) { | |
System.out.println("The employee payroll information does not exist."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment