49443da5
Vincent Benoist
tp avance
|
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
|
public class CompteEpargne extends Compte {
private double interet;
public double getInteret(){
return this.interet;
}
public void setInteret(double x){
this.interet = x;
}
public double interets(){
return (getCredit()-getDebit())*getInteret();
}
public void echeance(){
crediter(interets());
}
public void debiter(double val){
if((getCredit()-val)>0){
setDebit(getDebit()+val);
}else {
System.out.println("Compte non débitable");
}
}
public CompteEpargne(double creditInit, double interet){
super(creditInit);
setInteret(interet);
}
public CompteEpargne(){
super();
setInteret(0.1);
}
public String etat(){
return super.toString()+" Interets du mois: "+ interets();
}
public String toString(){
return super.toString()+" Interets du mois: "+ interets();
}
}
|