Advertisement
Luca_G6

CuentaBancaria.java

Mar 27th, 2020
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.25 KB | None | 0 0
  1. package tp1e10_Clases;
  2.  
  3. public class CuentaBancaria extends Cliente {
  4.  
  5.     private String Tipo_Cuenta;
  6.     protected float Saldo;
  7.     private String Informacion;
  8.     private String Estado_Mensual;
  9.     private String Cargos_Abonos;
  10.     private String Ultimas_Operaciones;
  11.    
  12.     public CuentaBancaria() {
  13.     }
  14.    
  15.     public CuentaBancaria(int v_n_cuenta, String v_t_cuenta, float v_saldo) {
  16.         if (v_n_cuenta != 0 && v_t_cuenta != "" && v_saldo >=0) {
  17.             this.Nro_Cuenta = v_n_cuenta;
  18.             this.Tipo_Cuenta = v_t_cuenta;
  19.             this.Saldo = v_saldo;
  20.         }else {
  21.             System.out.println ("Valores no admisibles");
  22.             this.Nro_Cuenta = 999999;
  23.             this.Tipo_Cuenta = "Pesos";
  24.             this.Saldo = 000000;
  25.         }
  26.     }
  27.    
  28.     public void setTipoCuenta(String v_t_cuenta) {
  29.         if(v_t_cuenta != "") {
  30.             this.Tipo_Cuenta = v_t_cuenta;
  31.         }else {
  32.             System.out.println ("Valores no admisibles");
  33.         }
  34.     }
  35.    
  36.     public void setSaldo(float v_saldo) {
  37.         if(v_saldo >= 0) {
  38.             this.Saldo = v_saldo;
  39.         }else {
  40.             System.out.println ("Valores no admisibles");
  41.         }
  42.     }
  43.    
  44.     public String getEstadoMensual() {return this.Estado_Mensual;}
  45.  
  46.     public void getImprimir() {
  47.         String v_imprimir = "Saldo:"+""+this.Saldo+","+"Ultimas Operaciones:"+""+this.Ultimas_Operaciones;
  48.         System.out.println(v_imprimir);
  49.     }
  50.    
  51.  
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement