Advertisement
Luca_G6

Cliente.java

Mar 27th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.00 KB | None | 0 0
  1. package tp1e10_Clases;
  2.  
  3. public class Cliente extends Persona {
  4.  
  5.     private int Id_Cliente;
  6.     protected int Nro_Cuenta;
  7.     private String Tipo_Abono;
  8.     private String Datos_Laborales;
  9.     private String Estado;
  10.  
  11.    
  12.     public Cliente() {
  13.     }
  14.    
  15.     public Cliente(String v_nombre, int v_n_cuenta, String v_estado) {
  16.         if (v_nombre != "" && v_n_cuenta >0 && v_estado != "") {
  17.             this.Nombre = v_nombre;
  18.             this.Nro_Cuenta = v_n_cuenta;
  19.             this.Estado = "Activo";
  20.         }else {
  21.              System.out.println ("Valores no admisibles");
  22.             this.Nombre = "Anonimo";
  23.             this.Nro_Cuenta = 999999;
  24.             this.Estado = "No habilitado";
  25.         }
  26.     }
  27.    
  28.     public void setAbrirCuenta() {
  29.         this.Estado = "Activo";
  30.     }
  31.    
  32.     public void setCerrarCuenta() {
  33.         this.Estado = "Inactivo";
  34.     }
  35.    
  36.     public int getNroCuenta() {return this.Nro_Cuenta;}
  37.    
  38.     public void getOperar() {
  39.      if(this.Estado == "Activo" ) {
  40.          System.out.println ("Este cliente puede operar");
  41.      }else {
  42.          System.out.println ("Este cliente NO puede operar");
  43.      }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement