2023-12-06 15:31:35 +01:00
|
|
|
/**
|
|
|
|
* Classe represantant un billet
|
|
|
|
*/
|
|
|
|
|
|
|
|
public class Billet {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* La valeur d'un Billet
|
|
|
|
*/
|
|
|
|
Denomination valeur;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Constructeur de Billet.
|
|
|
|
*
|
|
|
|
* @param val La valeur d'un Billet.
|
|
|
|
*/
|
|
|
|
public Billet(Denomination val){
|
|
|
|
this.valeur = val;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Methode renvoyant un entier correspondant a la valeur d'un billet.
|
|
|
|
* @return renvoie 0 si le billet est invalide.
|
|
|
|
*/
|
|
|
|
public int getInt(){
|
|
|
|
int output;
|
|
|
|
switch(this.valeur)
|
|
|
|
{
|
|
|
|
case Un:
|
|
|
|
output = 1;
|
2023-12-15 10:35:50 +01:00
|
|
|
break;
|
2023-12-06 15:31:35 +01:00
|
|
|
case Cinq:
|
|
|
|
output = 5;
|
2023-12-15 10:35:50 +01:00
|
|
|
break;
|
2023-12-06 15:31:35 +01:00
|
|
|
case Dix:
|
|
|
|
output = 10;
|
2023-12-15 10:35:50 +01:00
|
|
|
break;
|
2023-12-06 15:31:35 +01:00
|
|
|
/*case Vingt:
|
2023-12-15 10:35:50 +01:00
|
|
|
output = 20;
|
|
|
|
break;*/
|
2023-12-06 15:31:35 +01:00
|
|
|
default:
|
|
|
|
output = 0;
|
2023-12-15 10:35:50 +01:00
|
|
|
break;
|
2023-12-06 15:31:35 +01:00
|
|
|
}
|
|
|
|
return output;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|