44 lines
829 B
Java
44 lines
829 B
Java
|
/**
|
||
|
* 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;
|
||
|
case Cinq:
|
||
|
output = 5;
|
||
|
case Dix:
|
||
|
output = 10;
|
||
|
/*case Vingt:
|
||
|
output = 20;*/
|
||
|
default:
|
||
|
output = 0;
|
||
|
}
|
||
|
return output;
|
||
|
}
|
||
|
|
||
|
}
|