diff --git a/DEV3.2/Florent/ControleMachine/1/Billet.java b/DEV3.2/Florent/ControleMachine/1/Billet.java index 238d404..d157041 100644 --- a/DEV3.2/Florent/ControleMachine/1/Billet.java +++ b/DEV3.2/Florent/ControleMachine/1/Billet.java @@ -28,14 +28,19 @@ public class Billet { { case Un: output = 1; + break; case Cinq: output = 5; + break; case Dix: output = 10; + break; /*case Vingt: - output = 20;*/ + output = 20; + break;*/ default: output = 0; + break; } return output; } diff --git a/DEV3.2/Florent/ControleMachine/1/Denomination.java b/DEV3.2/Florent/ControleMachine/1/Denomination.java index 8f30cf6..b84cd09 100644 --- a/DEV3.2/Florent/ControleMachine/1/Denomination.java +++ b/DEV3.2/Florent/ControleMachine/1/Denomination.java @@ -3,8 +3,13 @@ * (Un billet peut avoir les valeurs suivantes Un, Cinq, Dix, Vingt) */ public enum Denomination { - Un, - Cinq, - Dix; + Un (1), + Cinq(5), + Dix(10); //Vingt; + private int valeur; + private Denomination(int v) + { + this.valeur = v; + } } diff --git a/DEV3.2/Florent/ControleMachine/1/Individu.java b/DEV3.2/Florent/ControleMachine/1/Individu.java index 6e9b924..f3d2ad7 100644 --- a/DEV3.2/Florent/ControleMachine/1/Individu.java +++ b/DEV3.2/Florent/ControleMachine/1/Individu.java @@ -38,7 +38,7 @@ public class Individu { */ public int getInt(){ int somme = 0; - for (Billet billet : monnaie) { + for (Billet billet : this.monnaie) { somme += billet.getInt(); } return somme; diff --git a/DEV3.2/Florent/ControleMachine/1/Main.java b/DEV3.2/Florent/ControleMachine/1/Main.java index a9d6eab..bd108ca 100644 --- a/DEV3.2/Florent/ControleMachine/1/Main.java +++ b/DEV3.2/Florent/ControleMachine/1/Main.java @@ -18,6 +18,9 @@ public class Main { Toto.addMonaie(new Billet(Denomination.Un)); Toto.addMonaie(new Billet(Denomination.Un)); + System.out.println(Titi.getInt()); + + System.out.println(Toto.getInt());