Guest User

Untitled

a guest
Jun 17th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. System.out.println(liquidacion.consultaDepartamento(numeroDepto));
  2.  
  3. public void insertaEmpleado(int numero, Empleado empleado) {
  4. plantilla.put(numero, empleado);
  5. }
  6.  
  7.  
  8. public String consultaDepartamento(int numero) {
  9. String mensaje = "LIQUIDACION POR DEPARTAMENTOn";
  10. double acumulador = 0.0;//acumular la liquidacion
  11. boolean encontrado = false;
  12.  
  13. Set<Integer> numeros = plantilla.keySet();
  14. Iterator<Integer> it = numeros.iterator();
  15. while (it.hasNext()) {
  16. Integer num = it.next();
  17. if (plantilla.get(num).getDepartamento().getNumeroDepartamento() == numero) {
  18. acumulador += plantilla.get(num).calcularLiquidacion();
  19. mensaje += plantilla.get(num).toString();
  20. encontrado = true;
  21. }
  22. }
  23.  
  24. if (encontrado) {
  25. return mensaje.toString() + "nFIN DE LISTADO DEPARTAMENTO";
  26. } else {
  27. return String.format("No existe el departamento introducido");
  28. }
  29. }
Add Comment
Please, Sign In to add comment