Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CuentaSueldo extends Cuenta implements IOperacionesComunes{
- private final static double tope = 15000;
- private int legajo;
- private String institución;
- private String beneficios;
- private long cbu;
- public CuentaSueldo() {
- }
- public CuentaSueldo(long cbu) {
- this.cbu = cbu;
- }
- public void setLegajo(int nro) {
- this.legajo = nro;
- }
- public void setInstitucion(String entrada) {
- this.institución = entrada;
- }
- public void setBeneficios(String entrada) {
- this.beneficios = entrada;
- }
- @Override
- public void retirar(double cantidad) {
- if(cantidad>this.saldo) {
- System.out.println("Su saldo es insuficiente");
- }else {
- if(cantidad>tope) {
- System.out.println("El tope de extracción es $"+tope);
- }else{
- this.saldo -= cantidad;
- System.out.println("Se retiró $"+cantidad);
- }
- }
- }
- @Override
- public String toString() {
- return "CuentaSueldo [Nro=" + Nro + ", Dni=" + Dni + ", saldo=" + saldo + ", interes=" + interes +", legajo=" + legajo + ", institución=" + institución + ", beneficios=" + beneficios
- + ", cbu=" + cbu + "]";
- }
- public void transferir(double monto, long cbu){
- if(this.saldo>=monto) {
- this.saldo -= monto;
- System.out.println("Tranferencia de $"+monto+" exitosa");
- }else {
- System.out.println("Fondos insuficientes");
- }
- }
- public void transferir(double cantidad, String alias){
- if(this.saldo>=cantidad) {
- this.saldo -= cantidad;
- System.out.println("Tranferencia de $"+cantidad+" exitosa");
- }else {
- System.out.println("Fondos insuficientes");
- }
- }
- @Override
- public void addBeneficios(String beneficio) {
- // TODO Auto-generated method stub
- this.beneficios += " "+beneficio;
- }
- @Override
- public void modificarCBU(long nuevo) {
- // TODO Auto-generated method stub
- this.cbu = nuevo;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement