Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package curso.umg;
- import java.util.ArrayList;
- import java.util.List;
- /**
- *
- * @author alumno
- */
- public class Banco {
- /**
- * @param args the command line arguments
- */
- private String nombre;
- private String direccion;
- private Cliente Clientes[];
- private int total, posicion;
- public Banco(int cantidadClientes) {
- this.total = cantidadClientes;
- posicion = 0;
- Clientes = new Cliente[total];
- }
- /*
- public Banco(){
- // TODO code application logic here
- String nombres[] = {"Juan Perez", "Pedro Lopez", "Juana Aquiles", "Lonera Herrera", "Benito Galvez", "Ernesto Garcia", "Luis Sincal", "Maria Sucuc", "Elvia Solano", "Mary Vivar"};
- int inicioEdad = 25;
- int inicioSalario = 100;
- Cliente cliente;
- for (int i = 0; i < 10; i++) {
- cliente = new Cliente();
- cliente.setNombreCompleto(nombres[i]);
- cliente.setEdad(inicioEdad + i);
- cliente.setSalario(inicioSalario * i);
- Clientes[i] = cliente;
- }
- }*/
- public void setCliente(Cliente cliente) {
- if (posicion >= total) {
- System.err.println("No se puede adicionar mas clientes");
- } else {
- Clientes[posicion] = cliente;
- posicion++;
- }
- }
- public void setNombre(String nombre) {
- this.nombre = nombre;
- }
- public void setDireccion(String direccion) {
- this.direccion = direccion;
- }
- public String getNombre() {
- return nombre;
- }
- public String getDireccion() {
- return direccion;
- }
- public int getTotal() {
- return total;
- }
- public Cliente[] getClientes() {
- return Clientes;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement