-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBancoDigital.java
More file actions
76 lines (68 loc) · 2.05 KB
/
BancoDigital.java
File metadata and controls
76 lines (68 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* 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 parcial;
/**
*
* @author ericc
*/
public class BancoDigital extends Banco {
private String url;
public BancoDigital(String url, String nombre, int cantidadDeEmpleados, int Ncuentas) {
super(nombre, cantidadDeEmpleados, Ncuentas);
this.url = url;
}
public String getUrl() {
return url;
}
@Override // comportamiento
public boolean agregarCuenta(Cuenta unaCuenta) {
return super.addCuenta(unaCuenta);
}
@Override // comportamiento
public String obtenerCuenta(String unCbu) {
String aux = " ";
int i=0;
boolean encontre = true;
while((i < super.getDl()) && (encontre)){
if(super.getCuentas()[i].getCbu().equals(unCbu)){
aux = super.getCuentas()[i].toString();
encontre = false;
}
i++;
}
return aux;
}
@Override // comportamiento
public boolean puedeRecibirTarjeta(String unCbu) {
int i=0;
boolean encontre = true;
boolean cumple = false;
while((i < super.getDl()) && (encontre)){
if(super.getCuentas()[i].getCbu().equals(unCbu)){
if (super.getCuentas()[i].getMoneda().equals("pesos")){
if(super.getCuentas()[i].getMonto() > 100000){
cumple= true;
encontre=false;
}
}
}
i++;
}
return cumple;
}
@Override // comportamiento
public void depositarDinero(String unCbu, double unMonto) {
int i=0;
boolean encontre = true;
while((i < super.getDl()) && (encontre)){
if(super.getCuentas()[i].getCbu().equals(unCbu)){
super.getCuentas()[i].setMonto(unMonto);
encontre = false;
}
i++;
}
}
}