The order matters? Step 75 of Calorie Counter course

Hi everyone!

In step 75 of the captioned course, the instruction says that:

It is time to start preparing your calculations. Start by declaring a consumedCalories variable, and assign it the sum of breakfastCalories , lunchCalories , dinnerCalories , and snacksCalories (note that order matters for the tests). Be sure to do this after your if statement.

I am confused at the part where it says “note that order matters for the tests”. What does it mean?
Does it imply that the result will be different if, say, I put the lunch variable ahead of the breakfast variable in the equation?

Hello @John_T !

That is correct.

I do not know if you have come across an issue where you entered the correct information, but in the wrong order, so the test was failing.
I have had this happen to me. It is frustrating.
But, it is teaching us to be careful with details, when adding our code, which will help, I would think, when working on our own with code.

Wishing you good progress.

1 Like

The results of addition don’t change based on the order that you do it in, but as stated in the instructions, the freeCodeCamp tests expect you to do the steps in a specific order.

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