Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package curso.umg;
  7.  
  8. import java.util.ArrayList;
  9. import java.util.List;
  10.  
  11. /**
  12. *
  13. * @author alumno
  14. */
  15. public class Banco {
  16.  
  17. /**
  18. * @param args the command line arguments
  19. */
  20.  
  21. private String nombre;
  22. private String direccion;
  23. private Cliente Clientes[];
  24. private int total, posicion;
  25.  
  26. public Banco(int cantidadClientes) {
  27. this.total = cantidadClientes;
  28. posicion = 0;
  29. Clientes = new Cliente[total];
  30. }
  31.  
  32. /*
  33. public Banco(){
  34. // TODO code application logic here
  35. String nombres[] = {"Juan Perez", "Pedro Lopez", "Juana Aquiles", "Lonera Herrera", "Benito Galvez", "Ernesto Garcia", "Luis Sincal", "Maria Sucuc", "Elvia Solano", "Mary Vivar"};
  36. int inicioEdad = 25;
  37. int inicioSalario = 100;
  38. Cliente cliente;
  39. for (int i = 0; i < 10; i++) {
  40. cliente = new Cliente();
  41. cliente.setNombreCompleto(nombres[i]);
  42. cliente.setEdad(inicioEdad + i);
  43. cliente.setSalario(inicioSalario * i);
  44. Clientes[i] = cliente;
  45. }
  46. }*/
  47.  
  48. public void setCliente(Cliente cliente) {
  49. if (posicion >= total) {
  50. System.err.println("No se puede adicionar mas clientes");
  51. } else {
  52. Clientes[posicion] = cliente;
  53. posicion++;
  54. }
  55. }
  56.  
  57. public void setNombre(String nombre) {
  58. this.nombre = nombre;
  59. }
  60.  
  61. public void setDireccion(String direccion) {
  62. this.direccion = direccion;
  63. }
  64.  
  65. public String getNombre() {
  66. return nombre;
  67. }
  68.  
  69. public String getDireccion() {
  70. return direccion;
  71. }
  72.  
  73. public int getTotal() {
  74. return total;
  75. }
  76.  
  77. public Cliente[] getClientes() {
  78. return Clientes;
  79. }
  80.  
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement