JavaScript - Building a Cash Register - 4. I Have to Scan It More Than Once? -- SCT is too lazy

bug-composer
javascript
sct

#1

I filled everything out and got a 404 Error.


#2

Can you send the url of the page you going to and getting error


#3

https://www.codecademy.com/forms/beta-thanks.html


#4

Could you tell me where you found that form?


#5

This is the form I was trying to use:

https://www.codecademy.com/forms/bugreport

I was on a different computer yesterday so I'm not sure the exact browser version but it was Chrome and the OS was OS X El Capitan


#6

I typed 'bug report codecademy' into the browser


#7

I'll see if I can get that old form removed or fixed.

You can report your bug here and we'll check to see what sort of bug it is.


#8

From JavaScript 'I have to scan it more than once?'

https://www.codecademy.com/en/courses/close-the-super-makert/0/4?curriculum_id=506324b3a7dffd00020bf661

When the parameter 'quantity' is included in the 'scan' function, the program prints to the console properly but the exercise does not pass on to the next one. The error message "Oops, try again. It doesn't seem like your 'quantity' actually works!" is displayed.

Conversely, if the 'quantity' parameter is left out, the the program does not print properly (ReferenceError: quantity is not defined) but I am allowed to pass on to the next exercise.

This seems the opposite of what should be happening, and contrary to the directions given in the exercise.

This code is allowed to pass on to the next exercise:

var cashRegister = {
total:0,
add: function(itemCost){
this.total += itemCost;
},
scan: function(item) {
switch (item) {
case "eggs": this.add(0.98 * quantity); break;
case "milk": this.add(1.23 * quantity); break;
case "magazine": this.add(4.9 * quantity); break;
case "chocolate": this.add(0.45 * quantity); break;
}
}
};

// scan each item 4 times
cashRegister.scan("eggs", 4);
cashRegister.scan("milk", 4);
cashRegister.scan("magazine", 4);
cashRegister.scan("chocolate", 4);

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

This is not allowed to pass on to the next exercise:

var cashRegister = {
total:0,
add: function(itemCost){
this.total += 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.9 * quantity); break;
case "chocolate": this.add(0.45 * quantity); break;
}
}
};

// scan each item 4 times
cashRegister.scan("eggs", 4);
cashRegister.scan("milk", 4);
cashRegister.scan("magazine", 4);
cashRegister.scan("chocolate", 4);

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

//I am not changing anything from one code set to the next except removing and including the 'quantity' parameter in the scan function.
enter link description here


#9

Your first scenario should not pass because it throws a ReferenceError: quantity is not defined.

Your second scenario will pass if you change the price of magazine to 4.99.

I'm still working on getting something done with the report form.

I'm going to move this over to the "Problems" category so that if we ever get going on fixing issues in the JavaScript exercises we'll be able to find it.

Thank you for taking the time to report these problems! :green_heart:


#10

An update: the buggy bug report form has been deleted.