Confusing wording for instructions


#1



I spent about an hour trying to figure out why my code wasn't working. Do you see it? I scanned 3 magazines at the end instead of 3 chocolates. My code wasn't broken, the wording of the instructions is just confusing:

"Then use the new method to void the last item we scanned. Finally, scan only 3 of the same item instead."

I know a lot of people would interpret this to mean 3 of the items referred to in the first sentence of the quote, but javascript is apparently starting to rub off on me because I interpreted the wording of the directions more literally than intended. Make sure you scan 3 chocolates, not 3 identical items from a different case of your choice. Hopefully they will make that tiny adjustment to the directions because it was driving me crazy.

var cashRegister = {
    total:0,
    lastTransactionAmount:0,
    //Dont forget to add your property
    add: function(itemCost) {
        this.total += itemCost;
        this.lastTransactionAmount = itemCost;
    },
    scan: function(item,quantity) {
        switch (item) {
        case "eggs": this.add(0.98 * quantity); break;
        case "milk": this.add(1.23 * quantity); break;
        case "magazine": this.add(4.99 * quantity); break;
        case "chocolate": this.add(0.45 * quantity); break;
        }
    },
    //Add the voidLastTransaction Method here
    voidLastTransaction: function() {
        this.total -= this.lastTransactionAmount;
    }
    
};

cashRegister.scan('eggs',1);
cashRegister.scan('milk',1);
cashRegister.scan('magazine',1);
cashRegister.scan('chocolate',4);

//Void the last transaction and then add 3 instead
cashRegister.voidLastTransaction();

cashRegister.scan("magazine",3);


//Show the total bill
console.log('Your bill is '+cashRegister.total);


#2

We're sorry you had problems with this, but cannot apologize for a course written over three years ago with this issue never coming up in that time. At any length, the course will be taken down by the new year so there is nothing we can do.

Only the last item scanned is stored in lastTransactionAmount and we don't need to know what it was to void it. Our code tells us that. If it is not obvious that the last item was chocolates then I don't know how else the instructions could be written.

This is rather a petty point to raise. You are at the very end of the track and should be able to think for yourself by this point, and not take your personal frustrations out on the wording of the instructions. This is free courseware, after all and we are expected to take responsibility for our own learning experience.


#3

Did I offend you in some way? I was just trying to point out that there is room for confusion in the directions. Just because no one has posted about it doesn't mean that it hasn't potentially been confusing. I just wanted to save someone a little head scratching by posting.

The directions could very easily say, "Finally scan only 3 chocolates instead," and not change any of the fundamental problem solving required for the exercise. The thing that I got hung up on had nothing to do with not understanding the concepts taught, it was because I didn't understand that a hypothetical person wanted 3 chocolates instead of 3 magazines.

I appreciate the quick response, but I feel like your language is very confrontational for no apparent reason. I really doubt that you speak for codecademy when you belittle people for asking questions, but I hope that they don't condone powertrips. This was my first post on here and probably my last as well. I hope that whatever frustrations you are having get worked out.


#4

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