38 lines
873 B
Java
38 lines
873 B
Java
|
public class Billet{
|
||
|
private Denomination valeur;
|
||
|
|
||
|
public Billet(Denomination valeur){
|
||
|
this.valeur = valeur;
|
||
|
}
|
||
|
|
||
|
public int getValeur(){
|
||
|
if (valeur == Denomination.UN){
|
||
|
return 1;
|
||
|
}
|
||
|
if (valeur == Denomination.DEUX){
|
||
|
return 2;
|
||
|
}
|
||
|
if (valeur == Denomination.CINQ){
|
||
|
return 5;
|
||
|
}
|
||
|
if (valeur == Denomination.DIX){
|
||
|
return 10;
|
||
|
}
|
||
|
if (valeur == Denomination.VINGT){
|
||
|
return 20;
|
||
|
}
|
||
|
if (valeur == Denomination.CINQUANTE){
|
||
|
return 50;
|
||
|
}
|
||
|
if (valeur == Denomination.CENT){
|
||
|
return 100;
|
||
|
}
|
||
|
if (valeur == Denomination.DEUX_CENT){
|
||
|
return 200;
|
||
|
}
|
||
|
if (valeur == Denomination.CINQ_CENT){
|
||
|
return 500;
|
||
|
}
|
||
|
return 0;
|
||
|
}
|
||
|
}
|