Bleep bleep


#1

Me again here is my code (sorry it's in french) the total bill is good and showed in the console but i've qot this message : oops,sorry try againt false

ar caisse = {
total:0,
//N'oubliez pas d'ajouter votre propriété

ajouter: function(prixElement) {
    this.total += prixElement;
    this.prixDerniereTransaction = prixElement;
},
scan: function(element, quantite) {
    switch (element) {
    case "oeufs": this.ajouter(0.98 * quantite); break;
    case "lait": this.ajouter(1.23 * quantite); break;
    case "magazine": this.ajouter(4.99 * quantite); break;
    case "chocolat": this.ajouter(0.45 * quantite); break;
    }
    return true;
},
//Ajoutez la méthode annuleDerniereTransaction ici 
annuleDerniereTransaction :  function() {
    this.total -= this.prixDerniereTransaction
},

};

caisse.scan('oeufs',4);
caisse.scan('lait',4);
caisse.scan('magazine',4);
caisse.scan('chocolat',4);

//Annulez la dernière transaction et ajoutez 3 à la place
caisse.annuleDerniereTransaction();
caisse.scan('chocolat',3);

// Affichez le total de la note
console.log('Votre total est de '+ caisse.total);


#2

@je22,
Try it with

caisse.scan('oeufs',1);
caisse.scan('lait',1);
caisse.scan('magazine',1);
caisse.scan('chocolat',4);

//Annulez la dernière transaction et ajoutez 3 à la place
caisse.annuleDerniereTransaction();
caisse.scan('chocolat',3);

// Affichez le total de la note
console.log('Votre total est de '+ caisse.total);

otherwise
please give the link to the exercise.....


#3

thanks a lot again you save me . i thought it va because of all the figures behind the dot in the result with my code but with the one you tell me to try now i"ve only 2 figures behind the dot in the result and now i can pass throught thanks again


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.